2016-08-29 3 views
0

Я разрабатываю пользовательский интерфейс, и я просто хочу добавить два FrameLayout в одном действии. Я хочу, чтобы один FrameLayout был заполнен родительским (полноэкранным) макетом, а другой FrameLayout был на первом макете. В основном я хочу, чтобы округленный круг фиксировался во всем приложении на каждом экране.Как добавить два FrameLayout в одном экране

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> 

Над кодом разделив экран на две части, я хочу, чтобы разместить меню на FrameLayout контейнера.

+0

Я пробовал с двумя рамками в линейной компоновке. Купить Я хочу показать один макет кадра в полноэкранном режиме, а другой на нем для меню –

ответ

0

Использование Относительная компоновка вместо линейной компоновки в качестве родительского макета и слишком малая макета гнезда занимает больше времени для рендеринга для вложенного макета.

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

попробуйте это.

Смежные вопросы