Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>well you can't force to stay at the bottom on tablets but if phone yeah you can do that through the manifest. but you can do something is similar to bottom bar and top bar. will in this example i'll show you how to use merge to do that easily without the need of using android ActionBar. </p> <p>first thing you need to create is your <code>main_activity.xml</code> in my case the <code>main_activity.xml</code> only contains <code>ImageView</code> on RelativeLayout. here is the code. </p> <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity" &gt; &lt;RelativeLayout android:id="@+id/RelativeLayout04" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentTop="true"&gt; &lt;include layout="@layout/header" /&gt; &lt;/RelativeLayout&gt; &lt;ImageView android:id="@+id/view" android:layout_width="match_parent" android:layout_height="200dp" android:layout_above="@+id/RelativeLayout03" android:layout_below="@+id/RelativeLayout04" android:layout_centerHorizontal="true" android:src="@android:drawable/alert_dark_frame" /&gt; &lt;RelativeLayout android:id="@+id/RelativeLayout03" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true"&gt; &lt;include layout="@layout/tryit" /&gt; &lt;/RelativeLayout&gt; </code></pre> <p></p> <p>as you can see in above code, there are two merges i put inside the <code>main_activity.xml</code> one defined at bottom and one defined at the top. here is the fake bottom bar xml. </p> <pre><code>&lt;merge xmlns:android="http://schemas.android.com/apk/res/android"&gt; &lt;LinearLayout android:id="@+id/LinearLayout01" android:layout_width="match_parent" android:layout_height="80dp" android:layout_weight="0.14" android:background="@drawable/dock" &gt; &lt;ImageView android:id="@+id/dark" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_weight="0.14" /&gt; &lt;ImageView android:id="@+id/stock" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_weight="0.14" /&gt; &lt;ImageView android:id="@+id/open" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_weight="0.14" /&gt; &lt;ImageView android:id="@+id/border" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_weight="0.15" /&gt; &lt;ImageView android:id="@+id/color" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_weight="0.15" /&gt; &lt;/LinearLayout&gt; </code></pre> <p></p> <p>i'm putting a fixed background to the <code>LinearLayout</code> and fake the ImageView for onClicks. </p> <p>and here is the top bar. `</p> <pre><code>&lt;LinearLayout android:id="@+id/LinearLayout02" android:layout_width="match_parent" android:layout_height="40dp" android:layout_weight="0.14" android:background="@drawable/dock1" android:layout_gravity="top"&gt; &lt;ImageView android:id="@+id/darka" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_weight="0.14" /&gt; &lt;ImageView android:id="@+id/stocka" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_weight="0.14" /&gt; &lt;ImageView android:id="@+id/opena" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_weight="0.14" /&gt; &lt;ImageView android:id="@+id/bordera" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_weight="0.15" /&gt; &lt;ImageView android:id="@+id/colora" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_weight="0.15" /&gt; &lt;/LinearLayout&gt; </code></pre> <p> `</p> <p>which also copy paste from the bottom bar above. just change one thing from <code>android:layout_alignParentBottom="true"</code> to <code>android:layout_alignParentTop="true"</code> and you got an actionBar at the bottom and at the top. in this case you wont need to use the ActionBar so i suggest you to use <code>Theme.Holo.NoActionBar</code> </p> <p>and here is the image result :- <a href="http://i.imgur.com/N8uKg6v.png" rel="nofollow">http://i.imgur.com/N8uKg6v.png</a> </p> <p>this is a project i'm working on Now. done almost everything but still struggling with the design. hope my answer benefit you. please vote the answer up if you found it interesting.<br> best regards. ~Kosh</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