这是我的警告对话:
AlertDialog.Builder builder = new AlertDialog.Builder(NewCar.this);
builder.setTitle("Make your selection");
builder.setItems(items, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int item) {
Log.v("this",items[item]+ " ");
}
});
AlertDialog alert = builder.create();
alert.show();
TextView titleView = (TextView)alert.findViewById(getResources().getIdentifier("alertTitle", "id", "android"));
if (titleView != null) {
titleView.setGravity(Gravity.RIGHT);
}
这是输出:
正如您所看到的,标题是从右到左,但我也无法将项目从右到左。
如何让物品从右向左移动?
谢谢你
答案 0 :(得分:1)
在xml(或代码中)创建自定义视图并使用
builder.setView(customView)