changing EditText - android

When I change the layout_height of an EditText field in Android, the nice looking gradient becomes a hard gray line as you can see here:
Is there a way to either fix or disable this gradient?
thx
Ben

You may want to just give it a different background, using a nine-patch presumably. (I have noticed this too and don't like it either! :) )

Related

android support lib 23.1.1 changes floating label color on setError()

is there a way to change the color of 'Password'? Basically, I prefer what support lib 23.1.0 had. I have a page that has multiple TextInputLayouts, and it would be hard to read if both hint and error are in red. please see the screenshot below.
there are a few fixes I want in 23.1.1, so please don't ask me to stay with 23.1.0. Thanks for all the help!!
Since it is a change in library it would be difficult to manipulate it. Android has decided to go that way (changing the label color along with the hint's color) and will become a standard soon and users will get familiar with it as time passes by. Not much we can do about it, but adhere, as always.
Workaround:
Don't set the Labels field on the TextInputLayouts. keep it blank and put another TextView just above it with the desired color and properly align it. That will not change, of course.
As per my comment below, you could also try this:
Hint color wont change. Just checked. So you may want to remove label and just add hint as android:hint="Enter password". The word Password in your screenshot is set in the Label and not as a hint.

Is there anyway to change the appearance of the EditText?

I want my edittext to be appeared as shown in pic1. My current edittext looks like pic2. Is there any way to change it through the edittext's properties? and why it is changing?
pic1
pic2
You can change the look of an EditText by changing the background image.
As has been pointed out, the reason it looks different is because of the android version. I don't recommend you use the old assets directly, but you could certainly make your own to look exactly how you want.

How to change EditText look programmatically?

I want to change default edittext look(Image:Look which i need to change) from box like look(Image:Look whic i need)...
This must be done programmatically,...I dont know how to do this...please help me
Edit : Sorry typed the title wrong
Edit:Why this is not a useful question??
who voted this question down...anybody please fix this by voting up...I cant post questions
I would create a 9patch image and then set the background drawable programmatically. Please look at this tutorial and see if it's of any help.
http://wptrafficanalyzer.in/blog/changing-background-color-and-border-color-of-an-edittext-widget-using-state-list-in-android/
EDIT: doing a little more research I've found that you can get the desired look&feel by just creating a shape in drawable.xml file. You can find some samples here: http://letustech.wordpress.com/2012/09/16/customedittext/ ... then just call setBackgroundResource on the EditText to set it programmatically.
Create a 9 patch drawble and use that as your background.Call setBackDrawable() to use it

Android - button text from up to down?

is there any way how to set text on button not from left to right, but from top to down?
Thanks
As far as I know, that's not possible.
However, if you find a solution I would not recommend using it. You're breaking the common way of how Android applications are meant to be designed. If an Android application is meant to be designed that way, Google would have a way to create a Button like you're describing.
May be you can statically specify button layout_width as some 5 dp or lower...and layout_height as wrap_content so that text will wrap next line..
then use setText..
Hope this helps...
If you create an Image, I mean a .png (and store it in drawable). In this png you store your word the way you want to be displayed. Then set that png as the button background then it may work for you.

Android dynamic background

I am somewhat of a new android developer and have a question regarding changing the background dynamically at runtime.
What I want to do is set a background color in a LinearLayout Tag, and later change that background color in my activity class. This code below is not working. Am I missing something or is this the wrong approach for trying to change the background color in a linear layout
LinearLayout lv = (LinearLayout)findViewById(R.id.ChoiceLayout);
lv.setBackgroundColor(0x000080);
Thanks in advance
First thing I've noticed is that your color has ALPHA = 0x00. Which makes it transparent. Try changing to
lv.setBackgroundColor(0xFF000080);
AFAIK, that should work fine. Use hierarchyviewer to try to diagnose what is going wrong.
already answered in another post , unfortunately i don't know that link but know the solution.
use
lv.setBackgroungColor(GetResources().getColor(int color));

Categories

Resources