2012-09-13 4 views

답변

1

약간 오래된 질문인데 이미 문제를 해결하는 방법을 알았을 수도 있지만, 같은 문제로 고생하는 사람들을위한 해결책이 있습니다.

참고 : 사실, documentation은 다음을 말한다 어떤 경우에는, 안드로이드 시스템은 작업 표시 줄에 가장 적합한을 보장하기 위해 드롭 다운 목록으로 당신의 작업 표시 줄 탭을 표시합니다.

는이 항목을 추가 한 후 당신의 탭 항목이 화면에 맞게 액션 바에 탭을 추가하지 마십시오 드롭 다운 목록 및 설정 탐색 모드 을 방지하기 위해. 그것 뿐이다

ActionBar bar = getSupportActionBar(); 
//bar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS); // Don't set navigation mode yet, if you do then portrait mode will revert to list mode if tab items don't fit the screen 
bar.setLogo(logo); 
bar.setHomeButtonEnabled(false); 
bar.setDisplayHomeAsUpEnabled(true); 
bar.setDisplayShowTitleEnabled(false); 

// Add lots of tab items 
for (int i = 0; i < channels.length; i++) { 
    ActionBar.Tab tab = bar.newTab(); 
    String[] s = channels[i].split(":"); 
    tab.setText(s[0]); 
    tab.setTag(s[1]); 
    tab.setTabListener(this); 

    bar.addTab(tab); 
} 

// Set navigation mode now, that will show all tabs in portrait mode instead of drop-down regardless the screen size 
bar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS); 

을 :)
관련 문제