アクティビティにTablayoutを表示してから、そのTabLayoutを右揃えにするImageButtonを表示するとします。私はこれには以下のレイアウトを使用していますが、タブが正しく表示されず、最後のタブが切り取られています。 TabLayoutの後にスクロール可能なタブとImageButtonを表示したい。アンドロイドでTabLayoutの右にビューを整列する
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_marginLeft="@dimen/margin_5dp"
android:layout_marginStart="@dimen/margin_5dp"
android:layout_marginRight="@dimen/margin_5dp"
android:layout_marginEnd="@dimen/margin_5dp"
android:background="@color/white"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.TabLayout
android:id="@+id/tabs"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:tabMode="scrollable"
app:tabGravity="center"
android:background="@color/gray_background"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<ImageButton
android:background="@color/gray_background"
android:layout_width="50dp"
android:layout_height="50dp"
android:scaleType="center"
android:id="@+id/add_sticker_store"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_marginLeft="@dimen/margin_5dp"
android:src="@drawable/ic_action_new"/>
<android.support.v4.view.ViewPager
android:layout_below="@id/tabs"
android:id="@+id/viewpager"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/gray_background"
android:layout_alignParentBottom="true"/>
<View
android:layout_width="match_parent"
android:layout_height="2dp"
android:layout_below="@id/tabs"
android:background="@color/white"/>
最後のタブがクロップ取得されたビューのスクリーンショットを確認してください。もし誰かがこれを達成する方法を知っていれば助けてください。
ありがとうございました。
を発行解決だと思う、それはTabLayoutとImageButtin間のルールを追加した後、今取り組んでいる、お返事ありがとうございました。どうもありがとう。 :) –