这是预期的行为吗?有没有办法呢?
编辑:
我刚刚重新创建了更简单的视图,这里是代码.
我也注意到它有预期的行为,如果我直接在布局中的视图,不包括它,因为我在这个例子,我需要它的工作.
这里是包括:
@H_403_9@<?xml version="1.0" enCoding="utf-8"?><linearLayout xmlns:androID="http://schemas.androID.com/apk/res/androID" androID:orIEntation="vertical" androID:layout_wIDth="wrap_content" androID:layout_height="wrap_content"> <linearLayout androID:layout_wIDth="100dp" androID:layout_height="100dp" androID:background="@androID:color/holo_red_dark" androID:elevation="24dp"/></linearLayout>和截图:
解决方法 看到你拥有的层次结构所以你应用了海拔1和3,这不是兄弟姐妹.显然,如果一个视图在层次结构中较高,则不应该施加阴影,而不管这些视图具有相同的高程或否.
如果你将高程应用到2而不是3,你将看不到阴影效果.
所以如果你只是将你的test.xml改为:
@H_403_9@<linearLayout xmlns:androID="http://schemas.androID.com/apk/res/androID" androID:orIEntation="vertical" androID:layout_wIDth="wrap_content" androID:layout_height="wrap_content" androID:elevation="24dp"> <linearLayout androID:layout_wIDth="100dp" androID:layout_height="100dp" androID:background="@androID:color/holo_red_dark"/></linearLayout>你会得到这个输出:
总结以上是内存溢出为你收集整理的Android – 具有相同高程的两个视图并排全部内容,希望文章能够帮你解决Android – 具有相同高程的两个视图并排所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)