【问题标题】:edittext inside tablerow androidtablerow android里面的edittext
【发布时间】:2013-06-07 01:57:47
【问题描述】:

我在 tablerow 中有一个 textview 和一个 edittext .. 我的问题是当我尝试在edittext中写很多字符时,我看不到我在写什么..宽度似乎有问题..有什么方法可以在我写的时候制作多行行或scolling edittext?

<TableLayout
    android:id="@+id/table"
    android:layout_height="wrap_content" 
    android:layout_width="fill_parent"
    android:paddingTop="30dip"
    android:paddingLeft="10dip"
    android:paddingRight="10dip"
    android:layout_below="@id/banner" >
    <TableRow>
        <TextView
            android:id="@+id/username_label"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textColor="#fff"
            android:textSize="18dip" 
            android:text="Username"
             />
        <EditText
            android:id="@+id/entry1"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content" />
    </TableRow>

    <TableRow>
        <TextView
            android:id="@+id/password_label"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:textColor="#fff"
            android:textSize="18dip" 
            android:text="Password" />
        <EditText
            android:id="@+id/entry2"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:password="true" />
    </TableRow>     
</TableLayout>

【问题讨论】:

  • 你想在edittext里面滚动吗,,,

标签: android scroll android-edittext tablerow


【解决方案1】:

你试过android:lines/android:maxLines吗?

【讨论】:

  • 如果我在 edittext 中设置了 android:lines="2" 那么我有 2 行 edittext 从开始...如果我在 edittext 中设置 android:maxLines 那么什么都不会发生..
  • android:inputType="textMultiLine" 怎么样?
【解决方案2】:

为您提供帮助。

<TableLayout android:id="@+id/table" android:layout_width="fill_parent"
    android:layout_height="fill_parent" android:stretchColumns="1"
    android:layout_below="@+id/banner">
    <TableRow>
        <TextView android:id="@+id/username_label"
            android:layout_width="wrap_content"     android:layout_height="wrap_content"
            android:textColor="#fff" android:textSize="18dip" android:text="Username" />
        <EditText android:id="@+id/entry1" android:layout_width="fill_parent"
            android:layout_height="wrap_content" />
    </TableRow>

    <TableRow>
        <TextView android:id="@+id/password_label"
            android:layout_width="fill_parent" android:layout_height="wrap_content"
            android:textColor="#fff" android:textSize="18dip" android:text="Password" />
        <EditText android:id="@+id/entry2" android:layout_width="fill_parent"
            android:layout_height="wrap_content" android:password="true" />
    </TableRow>
</TableLayout>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-09-19
    • 2012-08-08
    • 1970-01-01
    • 2021-10-30
    • 2016-09-04
    • 1970-01-01
    • 2022-01-10
    • 2011-09-04
    相关资源
    最近更新 更多