Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>If you want support from lower versions like 2.1 and higher I can propose my way. I always use separate XML layout for tray (footer in your case), for example (<strong>res/layout/tray.xml</strong>):</p> <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/mainMenu" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_gravity="bottom" android:background="#EEEEEE" android:gravity="bottom|fill_horizontal" android:orientation="horizontal" android:padding="5dp" &gt; &lt;ImageView android:id="@+id/addBtn" android:layout_width="50dp" android:layout_height="50dp" android:src="@drawable/add" android:layout_weight="0.2"/&gt; &lt;ImageView android:id="@+id/catalogBtn" android:layout_width="50dp" android:layout_height="50dp" android:src="@drawable/catalog" android:layout_weight="0.2"/&gt; &lt;ImageView android:id="@+id/searchBtn" android:layout_width="50dp" android:layout_height="50dp" android:src="@drawable/search" android:layout_weight="0.2"/&gt; &lt;ImageView android:id="@+id/settingsBtn" android:layout_width="50dp" android:layout_height="50dp" android:src="@drawable/settings" android:layout_weight="0.2"/&gt; &lt;ImageView android:id="@+id/infoBtn" android:layout_width="50dp" android:layout_height="50dp" android:src="@drawable/info" android:layout_weight="0.2"/&gt; &lt;/LinearLayout&gt; </code></pre> <p>And includes it in every <strong>Activity</strong> I need:</p> <pre class="lang-xml prettyprint-override"><code>&lt;include layout="@layout/tray" android:id="@+id/tray" /&gt; </code></pre> <p>After that I can in java code hide/show some buttons in tray by ID, or select some of them with another color ...</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