我有一个带有显示/隐藏菜单按钮的顶部栏。我想在相同的布局中定义顶部栏、按钮和菜单。
我尝试了顶部栏高度的布局,但菜单被剪裁并且不可见。是否有可能拥有比其父级更大的视图。否则,执行此操作的标准方法是什么?
对于你的问题:是的,这是可能的。简单的例子:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="match_parent"
>
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#f0f"
android:layout_marginLeft="-50dp"
android:layout_marginRight="-50dp"
/>
</LinearLayout>
And ImageViewWidth == LinearLayoutWidth + 100dp
.
希望有帮助。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)