我有一个带有显示/隐藏菜单按钮的顶栏.我想在相同的布局中定义顶部栏,按钮和菜单.
我尝试了一个顶部栏高度的布局,但是菜单被裁剪并且不可见.是否可能有比其父级更大的视图.否则,这样做的标准方法是什么?

jim*_*zer 11
对于你的问题:是的,这是可能的.简单的例子:
<?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>
Run Code Online (Sandbox Code Playgroud)
并且ImageViewWidth == LinearLayoutWidth + 100dp.
希望它的帮助.
| 归档时间: |
|
| 查看次数: |
2837 次 |
| 最近记录: |