Created
September 9, 2014 10:16
-
-
Save nein37/bdc982712c5e60d6c2b1 to your computer and use it in GitHub Desktop.
画面回転時のActionBarの挙動まとめ ref: http://qiita.com/nein37/items/2d247b6ca80ede6d548a
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<manifest > | |
<activity uiOptions="splitActionBarWhenNarrow" > | |
<meta-data android:name="android.support.UI_OPTIONS" | |
android:value="splitActionBarWhenNarrow" /> | |
</activity> | |
</manifest> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final ActionBar actionbar = getSupportActionBar(); | |
actionbar.setDisplayShowTitleEnabled(false); | |
actionbar.setDisplayShowHomeEnabled(false); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final ActionBar actionbar = getSupportActionBar(); | |
actionbar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS); | |
actionbar.addTab(actionbar.newTab().setText("ほげほげ").setTabListener(listener)); | |
actionbar.addTab(actionbar.newTab().setText("ぴよぴよ").setTabListener(listener)); | |
actionbar.addTab(actionbar.newTab().setText("かにかに").setTabListener(listener)); | |
actionbar.addTab(actionbar.newTab().setText("えびえび").setTabListener(listener)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final ActionBar actionbar = getSupportActionBar(); | |
actionbar.setDisplayShowTitleEnabled(false); | |
actionbar.setDisplayShowHomeEnabled(false); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final ActionBar actionbar = getSupportActionBar(); | |
actionbar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST); | |
actionbar.setListNavigationCallbacks(new ArrayAdapter<String>( | |
MyActivity.this,R.layout.list_item, | |
new String[]{"ほげほげ","ぴよぴよ","かにかに","えびえび"}), | |
new ActionBar.OnNavigationListener() { | |
@Override | |
public boolean onNavigationItemSelected(int i, long l) { | |
return false; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment