標籤:android style blog http io color ar java sp
核心: 自訂的View
Android 開發------------------ 修改 Actionbar 的樣式
Java代碼:
actionBar = getSupportActionBar(); ActionBar.Tab t = actionBar.getTabAt(i); t.setCustomView(R.layout.tab_layout_1); TextView title = (TextView)t.getCustomView().findViewById(R.id.tab_title); title.setBackgroundResource(R.drawable.detail); title.setText(sectionID);
布局檔案
<?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" > <TextView android:id="@+id/tab_title" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="5dp" android:layout_gravity="center_vertical|center" android:textColor="@android:color/holo_blue_dark" android:textSize="14sp" /> </FrameLayout>
Android 開發------------------ 修改 Actionbar 的樣式