开发者

Android layout problem with EditText?

开发者 https://www.devze.com 2023-03-27 10:21 出处:网络
I am desi开发者_运维百科gning an android user interface I am facing some problem in designing it can anybody guide me.

I am desi开发者_运维百科gning an android user interface I am facing some problem in designing it can anybody guide me.

Android layout problem with EditText?

I need UI same as the above where there is not space between 2 EditText.

Regards

Altaf


You need to change its background. The default Android EditText has padding because of its background.

Android layout problem with EditText?

Here's the EditText's background xml description:

<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_focused="true"
        android:drawable="@drawable/editbox_background_focus_yellow"/>
    <item android:drawable="@drawable/editbox_background_normal"/>
</selector>

Just provide image for these states, create a similar drawable xml file in your project and you'll be able to change how EditTexts look like.


You need to set the background to either your own drawable or a color. Try setting the background of each EditText to #FFFFFFFF, and make sure there are no margins set. That will cause them to be flush next to each other.

For the grey separator between the 2, add a View (just plain View) with layout_height of 1dp and layout_width of fill_parent between the two EditTexts. Then set the background color of that to #FF868686.

0

精彩评论

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