2016-03-05 96 views
0

我想在應用程序下方放置一個+圖標和一個鋼筆圖標,外觀與下圖類似。灰色部件的名稱是什麼?它叫tabHost?從我的理解,它用於帶有可滑動視圖的標籤佈局?移動標籤至底部

enter image description here

任何?????

回答

1

使用此代碼:

<?xml version="1.0" encoding="utf-8"?> 
<TabHost xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/tabhost" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" > 

    <LinearLayout 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" 
     android:orientation="vertical" 
     android:padding="5dp" > 


     <FrameLayout 
      android:id="@android:id/tabcontent" 
      android:layout_width="fill_parent" 
      android:layout_height="fill_parent" 
      android:padding="5dp" 
      android:layout_weight="1" > 

      <LinearLayout 
       android:id="@+id/ll_tab1" 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:orientation="vertical" /> 

      <LinearLayout 
       android:id="@+id/ll_tab2" 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:orientation="vertical" /> 

      <LinearLayout 
       android:id="@+id/ll_tab3" 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:orientation="vertical" /> 
     </FrameLayout> 
     <TabWidget 
      android:id="@android:id/tabs" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:layout_weight="0"/> 
    </LinearLayout> 

</TabHost> 
+0

@約翰喬訪問這個http://www.androidhive.info/2015/09/android-material-design-working-帶袢/ – 2016-03-07 10:53:49

1

使用的FrameLayout

<?xml version="1.0" encoding="utf-8"?> 
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:orientation="vertical" > 

    <RelativeLayout 
     android:layout_gravity="bottom" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" > 

     <ImageView 
      android:layout_alignParentRight="true" 
      android:id="@+id/imageView1" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:src="@drawable/abc_btn_radio_material" /> 

     <ImageView 
      android:layout_alignParentLeft="true" 
      android:id="@+id/imageView2" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:src="@drawable/abc_btn_check_material" /> 

    </RelativeLayout> 

</FrameLayout>