Posts

Showing posts with the label change Action Bar color in Sketchware

Codes for modifying Action Bar in Sketchware

Image
We can modify the Action Bar or Title bar in our Sketchware project, by using simple codes in onCreate method. Below I provide a few of those codes. Change title of Action Bar ActionBar ab = getActionBar(); ab.setTitle(" Title "); Replace the underlined text with the title you want to set. Change subtitle of Action Bar ActionBar ab = getActionBar(); ab.setSubtitle(" s​ubtitle "); Replace the underlined text with the subtitle you want to set. Show App icon in Action Bar ActionBar ab = getActionBar(); ab.setDisplayShowHomeEnabled(true); Set an image as icon in Action Bar Add the image to be displayed in Action Bar using Image Manager in your sketchware android project. Then add the following code in onCreate event. ActionBar ab = getActionBar(); ab.setIcon(getDrawable(R.drawable. imagename )); ab.setDisplayShowHomeEnabled(true); Replace the underlined text with name of the image added using Image Manager. Use Custom view in Action ...