android-titlebar

Change Spinner DropDown width

房东的猫 提交于 2019-12-03 11:02:18
问题 I need resize this part size to full display. How can i do this? My adapter: String[] navigations = getResources().getStringArray(R.array.actionBar); ArrayAdapter<String> adapter = new ArrayAdapter<String>( getBaseContext(), R.layout.custom_spinner_title_bar, android.R.id.text1, navigations); adapter.setDropDownViewResource(R.layout.custom_spinner_title_bar); actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST); actionBar.setListNavigationCallbacks(adapter, navigationListener); custom

Change Spinner DropDown width

那年仲夏 提交于 2019-12-03 01:26:31
I need resize this part size to full display. How can i do this? My adapter: String[] navigations = getResources().getStringArray(R.array.actionBar); ArrayAdapter<String> adapter = new ArrayAdapter<String>( getBaseContext(), R.layout.custom_spinner_title_bar, android.R.id.text1, navigations); adapter.setDropDownViewResource(R.layout.custom_spinner_title_bar); actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST); actionBar.setListNavigationCallbacks(adapter, navigationListener); custom_spinner_title_bar.xml: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http:/

getSupportActionBar().setTitle() vs toolbar.setTitle()

不问归期 提交于 2019-12-02 20:46:38
I am aware that there are two methods to setting a title in an Android Activity . Assuming I already have the following code... @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.my_activity); ... Toolbar toolbar = (Toolbar) findViewById(R.id.my_toolbar); setSupportActionBar(toolbar); ...I can use either this... getSupportActionBar().setTitle("My title"); ...or this... toolbar.setTitle("My title"); ...to set my title. My question is, which is the better practice ? Androider If you call setSupportActionBar(Toolbar) , then