2017-03-27 8 views
0

現在、私はAndroid UIで作業しています。 Tablayoutの上に重ねることができる大きなタブアイテムを作るために使用できる方法やプロパティです。事前にAndroidでTabLayoutをオーバーレイするより大きな項目

enter image description here

ありがとう:このカメラのボタンと同様に

+0

に関連するサイズを変更することができます。 あなたはこの記事を読んで、より明確な説明ができます。 http://www.android4devs.com/2015/12/tab-layout-material-design-support.html –

+0

@RoShanShan私はすでに自分のカスタムタブレイアウトを使用していますが、タブアイテムがどのように上の画像のようにtablayoutの境界をオーバーレイします。 : –

+0

下記のビューを確認 –

答えて

0

カスタムしてみてください。このように見ることができ、あなたは、カスタムの各TabLayoutのタブとは、手動でTabLayoutに追加することができ、あなたのアプリ

enter image description here

<?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="45dp" 
    android:orientation="vertical"> 

    <View android:layout_width="match_parent" 
     android:layout_height="1px" 
     android:layout_alignParentBottom="true" 
     android:layout_marginBottom="25dp" 
     android:background="@color/colorAccent"/> 

    <View android:layout_width="match_parent" 
     android:layout_height="1px" 
     android:layout_alignParentBottom="true" 
     android:background="@color/colorAccent"/> 

    <ImageView 
     android:id="@+id/imageView" 
     android:layout_width="35dp" 
     android:layout_height="35dp" 
     android:layout_centerInParent="true" 
     android:src="@drawable/ic_menu_camera" 
     android:layout_gravity="center_horizontal" 
     android:background="@android:color/white"/> 

</RelativeLayout> 
+0

別のレイアウトをTabLayoutの上に置くことを意味しますか?それを試しましたが、それがベストプラクティスですか?タブアイテムの位置をカスタマイズする方法はありますか? –

+0

いいえこれはカスタムレイアウトですより複雑なUIが必要な場合は、UIを使用することができ、TabLayoutを使用する必要はありません。 –

関連する問題