2
我想重現此選項卡指示器結構(屏幕來自nova啓動器):下拉菜單和右下角的箭頭。自定義選項卡指示器視圖
我對代碼沒有問題,但我不能重現這個樣子。 我嘗試這樣做:
mBar.addTab(mBar.newTab().setText(ctx.getString(R.string.tab_actions)).setTabListener(this).setCustomView(R.layout.navigation_spinner));
其中毫巴是福爾摩斯的支持動作條。
這是我的佈局:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_margin="-10dp"
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical">
<Button android:id="@+id/button1" android:layout_width="match_parent"
android:layout_height="match_parent" android:text="Button" />
</LinearLayout>
,這是我的結果:
的問題是,在中央標籤按鈕不填充選項卡指示器。我怎樣才能設置一個自定義視圖,完美填補指標沒有邊距或填充?或者我必須以不同的方式來解決這個問題,才能得到像第一屏那樣的結果?謝謝你的建議