2012-02-02 5 views
0

3 개의 탭이있는 작업 모음이 있습니다. 다음과 같이 보입니다. | 전체 | 전화 | 네트워크 | 나는 그들에게 같은 너비가 있기를 바란다. 내가 어떻게 해?ActionBar 탭 무게/너비

답변

2

으로 동일한 폭

<?xml version="1.0" encoding="utf-8"?> 
<TabHost 
xmlns:android="http://schemas.android.com/apk/res/android" 
android:id="@android:id/tabhost" 
android:layout_width="fill_parent" 
android:layout_height="fill_parent" > 
<LinearLayout 
    android:orientation="vertical" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent"> 
<HorizontalScrollView 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:fillViewport="true" 
    android:scrollbars="none"> 
<TabWidget 
    android:id="@android:id/tabs" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content"/> 
</HorizontalScrollView> 
<FrameLayout 
    android:id="@android:id/tabcontent" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" /> 
</LinearLayout> 
</TabHost> 

다음 설정 탭 호스트 행으로 정렬. 탭. 이게 내가 한 일이야. 내보기에는 ActionBar.Tag에서 사용하는 기본 제공 레이아웃과 비슷한 레이아웃에서 사용자 정의보기가로드되고 필요에 따라 여백, 크기 및 내용을 설정합니다.

+0

나는 그것에 대해 이야기 할 것입니다. 감사. –

+0

그것이 작동 했나요, Uriel 씨? – habitats

0

그들 모두는 사용자가 액션 바에서 setCustomView() 메소드를 사용하여 임의의 도면에 태그를 설정할 수

TabHost tabHost; 
TabHost.TabSpec spec; 
tabHost=getTabHost() 
Intent intent; 
intent=new Intent().setClass(this, BirthDayTab.class); 
spec=tabHost.newTabSpec("artists").setIndicator("BirthDay",res.getDrawable(R.drawable.ic_tab_artists)).setContent(intent); 
tabHost.addTab(spec); 
+2

번호를 찾고있다 정확한 솔루션입니다. ** ActionBar Tabs ** –