1.自定义Dialog布局
AlertDialog
mDialog = new AlertDialog.Builder(this).create();
mDialog.show();
Window window = mDialog.getWindow();
window.setContentView(R.layout.custom_dialog_list);
window.findViewById(R.id.xxxxx);//可找到布局的控件
注:dialog不能在子线程内显示
2.自定义actionbar布局
ActionBar.LayoutParams lp = new ActionBar.LayoutParams(
ActionBar.LayoutParams.MATCH_PARENT,
ActionBar.LayoutParams.MATCH_PARENT, Gravity.CENTER);
View actionBarLayout = getLayoutInflater().inflate(
R.layout.custom_actionbar, null);
getSupportActionBar().setCustomView(actionBarLayout, lp);
getSupportActionBar().setDisplayShowCustomEnabled(true);