Android Settings Icons

I want to create an Action Bar as follows: enter image description here

In the Dev manual, I saw that the Action bar icon should be in a certain size

Is it possible?

and also you can add an item to the action bar without specifying a click?

+4
source share
3 answers

I understand your problems with the size of the action bar icons, I had the same thing until I found this http://android-ui-utils.googlecode.com/hg/asset-studio/dist/index.html

it is a tool that resizes the icons for your content that you want to add to your application, it also provides several ready-to-use clips, you just need to click the download .zip button and you will get it.

Have fun designing your action bar.

+3
source

// use your own xml view to show your settings icons

View actionBarView = getLayoutInflater().inflate(R.layout.action_bar_custom_view, null); actionBar.setCustomView(actionBarView); actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM); 
+2
source

Yes, it can do it. But it’s good to stick to the recommended icon sizes. Since working with user interface recommendations goes a long way.

To make your left icon inactive, try setHomeButtonEnabled . Since this api is only available on ICS and above, and in previous versions, the icon is enabled by default. Thus, you can have an active icon that does nothing. (Well, you can live with this restriction, since there are not many 3.x devices there)

A custom view is your view, so its desire to make it clickable or not. To add a custom view,

 mActionBar = getActionBar(); mActionBar.setDisplayShowTitleEnabled(false); // if you dont want title mActionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM, ActionBar.DISPLAY_SHOW_CUSTOM); mActionBar.setCustomView(R.layout.action_bar_custom_view); 
+1
source

Source: https://habr.com/ru/post/1390183/


All Articles