我有一个名为my_layout.xml的布局xml文件,其中根视图的layout_wIDth和layout_height已指定为200px.
<com.jlee.demo.MyLayout xmlns:androID="http://schemas.androID.com/apk/res/androID" androID:orIEntation="horizontal" androID:layout_wIDth="200px" androID:layout_height="200px">
如果我使用此xml包含在另一个xml中,并将layout_wIDth和layout_height指定为100px.
<include layout="@layout/my_layout" androID:layout_wIDth="100px" androID:layout_height="100px"/>
my_layout的实际宽度/高度是多少?
解决方法:
这个问题中最高投票的答案可以帮助你:
Does Android XML Layout’s ‘include’ Tag Really Work?
您只能覆盖以layout_开头的参数.所以在你的情况下,布局应该是100 * 100.
总结以上是内存溢出为你收集整理的android – 会覆盖layout_width / layout_height值吗?全部内容,希望文章能够帮你解决android – 会覆盖layout_width / layout_height值吗?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)