android - How to add two FrameLayout in single screen -


i developing ui , want add 2 framelayout in single activity. want 1 framelayout fill parent(full screen) layout , framelayout on first layout. want make rounded circle fixed in entire application on each screen.

enter image description here enter image description here

         <?xml version="1.0" encoding="utf-8"?>         <linearlayout   xmlns:android="http://schemas.android.com/apk/res/android"         android:layout_width="match_parent"         android:layout_height="match_parent">            <linearlayout            android:layout_width="match_parent"            android:layout_height="match_parent"            android:orientation="horizontal" >           <linearlayout             android:orientation="vertical"             android:layout_width="wrap_content"             android:layout_height="wrap_content">          <imageview             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:id="@+id/home_menu"             android:layout_weight="1"             android:src="@drawable/ic_home"/>         <imageview             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:id="@+id/dis__menu"             android:layout_weight="1"             android:src="@drawable/ic_home"/>         <imageview             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:id="@+id/gallery_menu"             android:layout_weight="1"             android:src="@drawable/ic_home"/>         <imageview             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:id="@+id/download_menu"             android:layout_weight="1"             android:src="@drawable/ic_home"/>         <imageview             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:id="@+id/price_menu"             android:layout_weight="1"             android:src="@drawable/ic_home" />         <imageview             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:id="@+id/feedb_menu"             android:layout_weight="1"             android:src="@drawable/ic_home"/>         </linearlayout>        <framelayout            android:id="@+id/container_body"            android:layout_width="fill_parent"            android:layout_height="match_parent"            android:layout_weight="1">        </framelayout>        </linearlayout>        </linearlayout> 

above code dividing screen in 2 parts, want place menus on container body framelayout.

use relative layout instead of linear layout parent layout , don't nest layout take more time render nested layout.

<?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent">  <framelayout     android:id="@+id/container_body"     android:layout_width="match_parent"     android:layout_height="match_parent"     android:background="@color/darkgrey"></framelayout>  <linearlayout     android:layout_width="wrap_content"     android:layout_height="match_parent"     android:background="@color/blockbtncolor"     android:orientation="vertical">      <imageview         android:id="@+id/home_menu"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:layout_weight="1"         android:src="@drawable/ic_home" />      <imageview         android:id="@+id/dis__menu"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:layout_weight="1"         android:src="@drawable/ic_home" />      <imageview         android:id="@+id/gallery_menu"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:layout_weight="1"         android:src="@drawable/ic_home" />      <imageview         android:id="@+id/download_menu"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:layout_weight="1"         android:src="@drawable/ic_home" />      <imageview         android:id="@+id/price_menu"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:layout_weight="1"         android:src="@drawable/ic_home" />      <imageview         android:id="@+id/feedb_menu"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:layout_weight="1"         android:src="@drawable/ic_home" />  </linearlayout>  </relativelayout> 

try this.


Comments

Popular posts from this blog

amazon web services - S3 Pre-signed POST validate file type? -

c# - Check Keyboard Input Winforms -