我想夸大alertdialog中的自定义布局。我明白了,但宽度扩展为fill_parent。我已经尝试在xml文件中放置wrap_content或自定义大小(示例200dp),并且它已经fill_parent。自定义高度和宽度在自定义充气alertdialog布局android
我想把自己的高度和宽度,像(200dp,150dp),我怎么能把这个?
我已阅读并尝试过一些解决方案,但我无法解决我的问题,任何人都可以帮助我吗?在此先感谢。
我给我在这里的Java代码
`>View ff = getLayoutInflater().inflate(R.layout.customlayout, null);
>>Button menu = (Button)ff.findViewById(R.id.menu);
>>
menu.setOnClickListener(new View.OnClickListener() {
>>
public void onClick(View v) {
>// TODO Auto-generated method stub
>>gotomenu();
}
});
>
AlertDialog dialog = new AlertDialog.Builder(this)
>.setView(ff)
> .create();
> dialog.show();`
您好,感谢您的快速回答。我试过alertdialog扩展对话框,但对话框和这一行有错误,对话框()没有定义。我尝试使用Theme.Dialog解决方案,并且活动适应了我的xml大小,这很好,但是这有一个我不想要的标题。所以我已经搜索并在调用super.onCreate之后的活动中放入了:“requestWindowFeature(Window.FEATURE_NO_TITLE);”它工作正常!只是我在寻找!我很开心,谢谢你! – imtheuser