Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>To move the 'Screen' you'll need to call getLayoutParams() on the View, modify it as necessary and then call setLayoutParams() on the View.</p> <p>But for a great tutorial to how to implement a slide in menu see here:-</p> <p><a href="http://android.cyrilmottier.com/?p=658" rel="nofollow">http://android.cyrilmottier.com/?p=658</a></p> <p>To add further help, here's a layout that achieve's what I think you're after:-</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" &gt; &lt;LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/blue" &gt; &lt;/LinearLayout&gt; &lt;LinearLayout android:layout_width="200dip" android:layout_height="match_parent" android:layout_marginLeft="-100dip" android:background="@color/grey_divider" android:orientation="vertical" &gt; &lt;Button android:id="@+id/button1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Button" /&gt; &lt;/LinearLayout&gt; </code></pre> <p></p> <p>This will result in the second LinearLayout appearing 50% off the left hand side of the screen. FYI the LinearLayout you're moving will need an absolute width. But you could define it to FILL_PARENT in your xml, and then get the width and set it to this as an absolute value in code the first time you set the margin to a negative value.</p> <p>Hope this helps.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload