I have been trying to find a way to hide the title bar in my android application.
I used #android:style/Theme.NoTitleBar.Fullscreen in the android manifest. It worked but the background gets set to black and all the text views get set to white. Is their a way to have the background set to white and text to black without having to set them all individually?
For a simple version, try to use Theme.AppCompat.Light.NoActionBar. This will keep "light" theme but remove action bar.
You can ovveride the Theme.NoTitleBar.Fullscreen background color/text colors by applying additional styles. For example if you wanted your background color to be white you would apply the style:
#color/your_background__color
Related
I have developed an android application, there is a picture in the foreground. When I click on the picture, I make the background change (white if it is black, if it is black it will be white) at the same time I want to change the statusBarIcon color. and for that too
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
I use. In this way, the color of the statusbar icons is gray exactly as I want, and then I want to change the color of the icons to white.
getWindow().getDecorView().setSystemUiVisibility(0);
I am executing this command. everything is normal until here.. but when I do this, the color of the navigationBar icons also changes. How can I keep it or I want to change the color of the icons on the navigation bar
You can do it inside styles.xml using
<item name="android:navigationBarColor">#color/theme_color</item>
If you want to do it in code use
window.setNavigationBarColor(#ColorInt int color)
I have been having a tuff few days with the EditTextPreference object. No matter which emulator I use this on, it seems to change color slightly but always makes my text the same color as the widget itself. (Yes, I know it's not really a widget).
I can change the TEXT color and the BACKGROUND TEXT color in the XML code, but this does not help because the "CANCEL" and "OK" confirmation buttons (which are part of the widget)to tap are yellow and impossible to see on the white widget background.
Is there any way in XML to make this widget a different color? This has been very frustrating.
You can set background colour of any widget by property
android:background="#ffff00"
enter any hex code at place of #ffff00
You can pick up hex code from here
you can also set a picture as a background of widget
android:background="#drawable/your_image"
place your_image in drawable folder
Hello I have some questions for adding images for a ImageButton.
I have an icon for example a play button now if I hover over the button it just should get a blue surounding box the inside Image should not change.
Should I draw for every icon the two states or are there other options.
If an button is not clickable it should get Grey. Same how to do this? Add an additional Image to every Icon?
For what is the Checked drawable in the ImageButton?
ImageButtons have a drawable for their background (up, down, over, etc.) and a drawable for the image on top of the button (imageUp, imageDown, imageOver, etc.). The only ones you must provide are up for the background and imageUp for the icon. These are the defaults used when you leave the other states null. But for visual reasons, you need down for the background or it will be hard to tell if the button is being pressed. It's up to you whether you think you need to also change the icon appearance with an imageDown.
All you need is to add the background drawable for disabled. If you want the icon to also turn gray, you need to create a gray version of the icon and assign it to imageDisabled.
The Buttons in Scene2d all support toggle functionality. When you press it, it will toggle to the checked state, so you can use the checked drawable to change its appearance while it is stuck down. If you don't want that to happen, leave the checked drawable null.
I need to dynamically set the icon in the title bar. Currently I have this code in my activity:
requestWindowFeature(Window.FEATURE_LEFT_ICON);
setContentView(R.layout.table_layout_activity);
getWindow().setFeatureDrawableResource(Window.FEATURE_LEFT_ICON, R.drawable.icon_procedure);
This works fine, except that it changes the font size and it removes the (default) border line at the bottom of the bar. I'd like to only set the icon and leave everything else as default.
Default title bar:
.
Custom icon:
.
Anyone can help?
Icon can be changed in multiple ways for Activities, programmatically for an individual activity as
In onCreate()
getActionBar().setIcon(R.drawable.icon);
// icon is image in res/drawable folder.
Or in actionbar theme, by adding this to your ActionBar style.
<item name="android:icon">#drawable/icon</item>
<!-- This changes icon universally for all Activities in application -->
Since you are using the action bar, use setIcon() on ActionBar to change the icon, and get rid of that other stuff.
Use setIcon() on actionBar() or change it directly in androidManifest.xml
How to change (using theme modifications) the default color of selector (ListView, GridView) and Tab selector/underline color.
I use actionbarsherlock and Theme.Sherlock as main application theme.
Below are the pictures describing what do I want to change.
Thanks
Unfortunately, if you want to style your action bar you will need to style its parts individually - there is no color attribute that would change the light blue color to something else.
Basically what you need to do is override styles and change some of the attributes and add some new drawables. If your action bar includes spinners, dropdown panels, radio buttons etc. you'll also need to provide new colored images for those. I recommend that you check the ActionBarSherlock styled sample (which you downloaded with the library), particularly its styles.xml.