将两个编辑框加入Android中的1个编辑框

时间:2013-07-29 05:02:37

标签: android editbox

我是android新手。 我想将两个EditBox加入到1个EditBox中。 任何人都可以帮助我。 提前致谢。 I am adding the screen shot that i need

2 个答案:

答案 0 :(得分:2)

为垂直方向的线性布局提供背景,并在其中添加两个透明文本框。

<LinearLayout android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/background_of_big_edittext"
    android:orientation="vertical" >

    <EditText
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@android:color/transparent" />

    <View
        android:layout_width="match_parent"
        android:layout_height="1dp"
        android:background="@color/color_of_your_divider" />

    <EditText
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@android:color/transparent" />

</LinearLayout>

答案 1 :(得分:1)

我不知道你是否在谈论用户界面。但是您可以通过get text方法从编辑文本中获取文本。为什么你不能将文本加入单个字符串并在程序中使用组合字符串?