Underline of Edittext control disappears in Xamarin - android

I am using the Holo Dark Theme in my Android application in Xamarin. I devided my page (Activity) in different layouts. And I gave one the left layouts a white background (in contrast to the default black background of the Holo Dark Theme).
The Edittext controls in the dark side have the default gray underline bellow the edittext control (right side).
But this underline has now disappeared in the white area. Look at the picture:
I don't know why. How can I make the line visible again?

The bottom border of EditText control is draw as a background on Android. Maybe you changed the background of EditText controls so that the gray bottom borders are disappeared.

Related

What's the default background colour res which changes based on dark mode? [Android]

I have a coordinator layout which has a bottom sheet.
By default, my bottom sheet's background is transparent. So I put color/white as the background res for the parent layout.
This works fine in light mode, but in dark mode, my text automatically adjusts its colours to white to suit dark mode. But now with the white background of the bottom sheet, I can't see the text.
Typically with dark/light modes, material design tends to handle the switching of colours mostly for you. However, since I have to define a background colour for my bottom sheet, I'm not sure what to define for it so that it switches to white/dark grey depending on dark/light mode.
Is there some system included colour res I can use which will change the background colour for me with material design?
Follow Location:
res>values>themes>themes.xml(night)
then add tag inside tag.
<item name="android:colorBackground" tools:targetApi="l">#color/white</item>
This will change your background color to white only in dark mode.
You can do the same in light mode.
Note:
Do not add colour in layout resource file.

How to change the EditText background Tint color in Android?

I am developing an app using Material theme. In my app, I'm having multiple edit texts to get the input from user.
I've divided the screen into two portions:
top portion background color is white background so it showing the default material theme style but
bottom portion I'm using the blue color,
If I'm using the same style in the bottom portion, EditText background tint not visible clearly. So I'm planning to change the background tint color.It supports the lollipop version. I want to show style for below versions also.
How can I do this?
Take a look at this. android.support.v4.graphics.drawable.DrawableCompat#setTint
With this you can set the tint to your EditText.
DrawableCompat

android : what decided edit text default border colour on focus

I have two different apps and how the edittext appears in both are different. In one when i focus , the border is getting an orange colour and in other app its blue. I am not setting background in either the app. So how is the difference coming. Is it the android version selected ?
The default styling of widgets is controlled by the theme used by the activity. From your described symptoms, my guess is that you have not specified any theme, which means that you will get an orange focus ring on Android 1.x/2.x, a blue border on Android 3.x/4.x, and IIRC a gray border (subject to custom tints) in Android 5.0+.
More tactically, the focus is part of the EditText background, which will be a StateListDrawable pointing to other drawables for the various states (normal, focused, disabled, etc.).

EditText borders SDK >11

I've an activity with few EditTexts, it shows the underlying borders until no background is set. When I set a background for the whole LinearLayout, the EditText's highlighting gray borders go away. Only blue highlights appear when focussed.
How do I get those gray borders like in the screenshot below:
Setting the theme in manifest does the trick:
android:theme="#android:style/Theme.Holo.Light.DarkActionBar"

How to Change the Color Behind Android Dialog

I would like to change the color of the dimmed background that surrounds an Android dialog (not the Window background drawable) programmatically. I am using a dialog themed activity. I do not want to dim it, nor blur it.
If you imagine a dialog with three buttons, I would like to have it do something like this:
Click A: background to translucent red
Click B: background to translucent yellow
Click C: background to translucent green
I'm not sure you can change the color of the background. The dimming is controlled by the dimAmount field of the layout for the dialog window (as well as the FLAG_DIM_BEHIND flag). dimAmount is just a float between 0.0 and 1.0 that controls the amount of dimming (transparent to totally opaque). I think it's just an alpha blend of the existing background; there's no control of coloring as far as I've been able to find.
If you're using Activity with Theme.Dialog then you should look into your xml file for layout and then change background color of outermost container.

Categories

Resources