0

My layout conains two linearlayout.
As below: 

<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>

There are l1 and l2.
I want let my menu bar only belong l1 and show on l1.
But not show cross over l1 and l2.
How can I do it?

brian
  • 6,802
  • 29
  • 83
  • 124
  • Could you elaborate a little more? What "menu bar" should be shown on just the l1 LinearLayout? – Siddharth Lele Aug 13 '12 at 07:42
  • I mean the *.xml in /res/menu/ folder. – brian Aug 13 '12 at 07:46
  • In normal, it wil cross two layout. – brian Aug 13 '12 at 07:47
  • I want it only show on left layout. – brian Aug 13 '12 at 07:47
  • You mean when the "menu" button is pressed? I am sorry, but I still don't get your question. What do you mean by "it will cross two layouts"? You could post a screenshot to give a clearer picture. – Siddharth Lele Aug 13 '12 at 07:49
  • I mean like tis picture http://ppt.cc/Fx4o . – brian Aug 13 '12 at 07:58
  • I want the menu's width same as left layout and show on the bottom of l1. – brian Aug 13 '12 at 07:59
  • As @Andy Res has posted in his answer, this cannot be done. The only was it could possibly be done (as he answers) is to define a custom menu. Or you could possibly explore the option of a "Quick Action Dialog" and override the menu button to display that instead of the standard Menu. For more info, see this link: http://stackoverflow.com/questions/3059155/android-quick-actions-ui-pattern – Siddharth Lele Aug 13 '12 at 08:06

1 Answers1

2

You cannot control the layout of menu options. The only option is to define your custom menu for what you want to achieve.

Andy Res
  • 15,963
  • 5
  • 60
  • 96