I design with android 4.0.3: theme.holo
When i change back color of edittext,It show lines is black color at first edittext.
How do hides black line of edittext when change background color?
Watch image: Click Here
you should be able to use
android:cursorVisible="false"
in your xml or
editTxt.setCursorVisible(false);
from java
EDIT:
Use an OnFocusChangeListener on the EditText to get a callback when it gets and loses focus and use the setCursorVisible() method to set the cursor to whichever state you need.
you can set android:textCursorDrawable="#null" in your layout
Related
Getting quite frustrated with this issue.
I have got two underlines for all my EditText and I don't know why this is happening.
How do I remove the black underline color?
The turquoise underline is part of the default EditText widget background. You can remove it by setting the background XML attribute to #null.
The black underline is likely caused by predictive text. This can be corrected by adjusting your inputType, also in XML.
When I write a text in an EditText it gets underline until I hit the space key. I've tried:
android:inputType="textNoSuggestions"
But it's not helping
If you are talking about the default 'underlining' of EditText, try setting its background to transparent.
try to add following lines in java code-
mEditText.setHorizontallyScrolling(true);
mEditText.setInputType(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
If you need to support API 4 and below, use android:inputType="textFilter"
Is there a way to totally remove the Icon from a RadioButton?
I'm bolding the text instead of using the icon.
Setting android:button to either #null or #android:color/transparent
only hides the button and still messes up my test positioning.
I suppose that I could use a dummy view that's only 1dip big, but I wanted to check if there was less of a hack.
Try setting the background and button to #null.
set android:button="#null" will remove the default radio icon
I am displaying a ListView. When I drag over it, the entire ListView is selected with a black background. How can I remove that black background?
just use in ur xml file inside ListView,
android:cacheColorHint="#android:color/transparent"
It's probably because you have a custom background for your ListView. When you scroll those, the entire list gets highlighted in a black color due to its cache color.
Add this piece of code to your ListViewand try again:
android:cacheColorHint="#00000000"
view.setBackgroundColor(android.R.color.transparent);
should be view.setBackgroundResource(android.R.color.transparent)
cause setBackgroundColor take a hex color value as parameter.
or
android:cacheColorHint = "#00000000"
use this tag for the your listView. or you can also use
listview.setCacheColorHint()
to set it programatically.
From Why is my list black? An Android optimization on the Android developers' blog:
To fix this issue, all you have to do is either disable the cache color hint optimization, if you use a non-solid color background, or set the hint to the appropriate solid color value. This can be dome from code or preferably from XML, by using the android:cacheColorHint attribute. To disable the optimization, simply use the transparent color #00000000. The following screenshot shows a list with android:cacheColorHint="#00000000" set in the XML layout file:
use this,
yourList.setCacheColorHint(Color.WHITE);
all
When i clicked in the EditText box to type something the border color of the EditTet box was changed.I dont need that,but i want to enter the text in the EditText box.
I tried a xml tag tag
android:focusable="false".
But its not working .How to do this?
Thanks in advance.
this probably will work..
editText.setOnFocusChangeListener(new OnFocusChangeListener(){
protected void onFocuschanged(){
editText.setBackground(#android:drawable.editbox_background);
}
});
go to editText in xml and add this tag,
android:gravity="left"
Easiest way I can think of is just use the editbox_background_normal ninepatch image and make yourself a selector that uses this image for the background in all states (default, focused, pressed) that way the view will not appear to the user to change at all.
Then just set the background of the EditText to your selector.