2012-08-13 21 views
0

我的布局包含两个线性布局。
如下:在一个布局上显示菜单栏

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:id="@+id/LinearLayout1" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:orientation="horizontal" > 

    <LinearLayout 
     android:id="@+id/l1" 
     android:layout_width="fill_parent" 
     android:layout_height="match_parent" 
     android:layout_weight="1" 
     android:gravity="right" 
     android:orientation="vertical" > 

     <Button 
      android:id="@+id/b1" 
      android:layout_width="18dp" 
      android:layout_height="match_parent" 
      android:text=" ﹒﹒﹒" 
      android:textSize="20dp" /> 

    </LinearLayout> 

    <LinearLayout 
     android:id="@+id/l2" 
     android:layout_width="fill_parent" 
     android:layout_height="match_parent" 
     android:layout_weight="1" 
     android:background="#000000" 
     android:orientation="vertical" > 

    </LinearLayout> 

</LinearLayout> 

有L1和L2。
我想让我的菜单栏只属于l1并显示在l1上。
但是不能显示跨过l1和l2。
我该怎么做?

+0

你能再详细一点吗?什么“菜单栏”应该只显示在l1 LinearLayout上? – 2012-08-13 07:42:28

+0

我是指/ res/menu /文件夹中的* .xml。 – brian 2012-08-13 07:46:50

+0

正常情况下,它将跨越两个布局。 – brian 2012-08-13 07:47:20

回答

2

您无法控制菜单选项的布局。唯一的选择是定义您想要实现的自定义菜单。

相关问题