1
我已經實現了Sherlock Actionbar,目前有一個textview是動態變化的。我想設置3個文本視圖極右分角和中間以及最後一個在極端的左邊。我怎麼能做到這一點? textview萬有引力不工作既不是佈局gravity.is他們的任何方式來實現這個?我的代碼文本視圖,現在顯示在操作欄的最左角。將Textview設置在極右角和動作條中間
mActionBar = getSupportActionBar();
mActionBar.setDisplayShowHomeEnabled(false);
mActionBar.setDisplayShowTitleEnabled(false);
mInflater = LayoutInflater.from(this);
mCustomView = mInflater.inflate(R.layout.actiontext, null);
mTitleTextView = (TextView) mCustomView.findViewById(R.id.menutesttext);
mActionBar.setCustomView(mCustomView);
mActionBar.setDisplayShowCustomEnabled(true);
和文本查看我的XML文件是
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/expand_activities_button"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center"
android:clickable="false"
android:focusable="true"
android:addStatesFromChildren="true">
<TextView android:id="@+id/menutesttext"
android:layout_width="82dp"
android:layout_height="20dp"
android:layout_gravity="center"
android:gravity="center"
android:text="Testing"/>
</FrameLayout>
現在我想的是另設2個文本視圖在這個框架佈局,使之在我的動作條像可調,
TEXTVIEW1 TEXTVIEW2 TEXTVIEW3
我不想實現選項卡views.Just要以上述方式實現3 textview。