问题描述
我在我的应用程序创建一个AlertDialog。在Android的大号AlertDialog按钮适合在对话框中,但在Android的大号按钮标签将自动转换成首字母大写和按钮不适合在对话框中。请看截图:安卓L:
Android的奇巧:
是任何人看到这个问题。任何可以帮助我解决这个问题,虽然这是最新的Android版本。
code :(我没有使用XML code创建对话框,在这里是用java code:)
AlertDialog.Builder警报=新AlertDialog.Builder(本);
alert.setTitle(R.string.feedback_label);
alert.setMessage(msgStrId);
alert.setNegativeButton(R.string.close_label,新DialogInterface.OnClickListener(){
@覆盖
公共无效的onClick(DialogInterface对话,诠释它){
// TODO自动生成方法存根
}
});
alert.setPositiveButton(R.string.rate_app,新DialogInterface.OnClickListener(){
@覆盖
公共无效的onClick(DialogInterface对话,诠释它){
// TODO自动生成方法存根
}
});
alert.setNeutralButton(R.string.feedback_label,新DialogInterface.OnClickListener(){
@覆盖
公共无效的onClick(DialogInterface对话,诠释其)
{
// TODO自动生成方法存根
}
});
alert.setOnCancelListener(新DialogInterface.OnCancelListener()
{
@覆盖
公共无效OnCancel的(DialogInterface对话框)
{
// TODO自动生成方法存根
}
});
AlertDialog alertDialog = alert.create();
alertDialog.show();
我认为它会为你工作。 https://github.com/drakeet/MaterialDialog
I have created a AlertDialog in my app. Before Android L AlertDialog buttons fit in dialog box, but in Android L buttons label automatically converts in title case and buttons not fit in dialog box.Please see screenshots:Android L:
Android Kitkat:
Is anybody see this issue. Can any help me to solve this problem, although this is latest android version.
Code: (I have not used xml code to create dialog, here is java code:)
AlertDialog.Builder alert = new AlertDialog.Builder(this);
alert.setTitle(R.string.feedback_label);
alert.setMessage(msgStrId);
alert.setNegativeButton(R.string.close_label, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// TODO Auto-generated method stub
}
});
alert.setPositiveButton(R.string.rate_app, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// TODO Auto-generated method stub
}
});
alert.setNeutralButton(R.string.feedback_label,new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which)
{
// TODO Auto-generated method stub
}
});
alert.setOnCancelListener(new DialogInterface.OnCancelListener()
{
@Override
public void onCancel(DialogInterface dialog)
{
// TODO Auto-generated method stub
}
});
AlertDialog alertDialog = alert.create();
alertDialog.show();
I think it will works For You.https://github.com/drakeet/MaterialDialog
这篇关于在Android的大号警报对话框按钮的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!