
问题是 android:我从< shape>切换后台drawable后似乎忽略了padding值到< @R_172_3419@>.
布局/ List_item.xml
<linearLayout xmlns:androID="http://schemas.androID.com/apk/res/androID" androID:ID="@+ID/layout_List_item_bill" androID:orIEntation="vertical" androID:layout_wIDth="match_parent" androID:layout_height="wrap_content" androID:padding="12dp"> . . .</linearLayout>
绘制/ List_item_background.xml
<shape xmlns:androID="http://schemas.androID.com/apk/res/androID" androID:shape="rectangle"> <solID androID:color="@color/white" /> <corners androID:radius="@dimen/corner_radius" /> <stroke androID:wIDth="1dp" androID:color="@color/blue" /></shape>
以上工作如预期.当我将drawable / List_item_background.xml更改为时,填充消失
<@R_172_3419@ xmlns:androID="http://schemas.androID.com/apk/res/androID"> <item> <shape> <solID androID:color="@color/white"/> </shape> </item> <item> <shape androID:shape="rectangle"> <solID androID:color="@color/white" /> <corners androID:radius="@dimen/corner_radius" /> <stroke androID:wIDth="1dp" androID:color="@color/blue" /> </shape> </item></@R_172_3419@>
我错过了什么?
解决方法 包装<层列表>在< selector>中解决了这个问题:<selector xmlns:androID="http://schemas.androID.com/apk/res/androID"> <item> <@R_172_3419@> <item> <shape> <solID androID:color="@color/white"/> </shape> </item> <item> <shape androID:shape="rectangle"> <solID androID:color="@color/white" /> <corners androID:radius="@dimen/corner_radius" /> <stroke androID:wIDth="1dp" androID:color="@color/blue" /> </shape> </item> </@R_172_3419@> </item></selector>总结
以上是内存溢出为你收集整理的后台禁用android:padding设置全部内容,希望文章能够帮你解决后台禁用android:padding设置所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)