开发者

Removing the focus of the Editbox in android

开发者 https://www.devze.com 2023-03-29 05:09 出处:网络
all When i clicked in t开发者_StackOverflow社区he 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.

all

When i clicked in t开发者_StackOverflow社区he 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.

Removing the focus of the Editbox in android

0

精彩评论

暂无评论...
验证码 换一张
取 消