且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Android的自定义对话框高度

更新时间:2023-01-24 13:11:33

你有你的TextView的高度FILL_PARENT。是否有可能,这与RelativeLayout的高度结合,WRAP_CONTENT是推动其高度的最大尺寸是多少?如果你改变了TextView的高度为wrap_content会发生什么?

You have the height of your TextView to fill_parent. Is it possible that this, combined with the height of the RelativeLayout to wrap_content is pushing its height to the maximum size? What happens if you change the TextView height to wrap_content?

要添加,了Android SDK 说,一个RelativeLayout的子女不能有依赖在布局,如align_parent_bottom。我认为FILL_PARENT是一个依赖,因而是打破布局。

To add, the Android SDK says that children of a RelativeLayout can not have a dependency on the Layout, such as align_parent_bottom. I assume that fill_parent is a dependency and thus is breaking the layout.