[英]I need action bar tabs with custom title bar android
我需要Android中帶有自定義標題欄的操作欄標簽。 我正在使用此代碼
actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
actionBar.setCustomView(R.layout.customtitle);
但它不能正常工作。 當前選項卡顯示在標題下方。 我需要標題顯示在選項卡下面。 誰能幫我?
根據http://developer.android.com/reference/android/app/ActionBar.html
setCustomView(View view, ActionBar.LayoutParams layoutParams)
此函數在第二個參數中采用ActionBar.LayoutParams參數。 所以你可以做到
final View actionCustomView = getLayoutInflater().inflate(
R.layout.custom_action_bar, null);
actionBar.setCustomView(actionCustomView, new ActionBar.LayoutParams(
android.view.ViewGroup.LayoutParams.MATCH_PARENT,
android.view.ViewGroup.LayoutParams.WRAP_CONTENT));
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.