gpt4 book ai didi

java - 如果我按 Enter 或关闭键盘,EditText 会更改大小

转载 作者:行者123 更新时间:2023-12-01 18:04:26 24 4
gpt4 key购买 nike

如果我在 EditText 中写入数字,大小不会改变 Pic1 ,但是如果我按 Enter 或关闭键盘,EditText 会更改大小。 Pic2可以把它关掉吗? (所有 TableRows 和 EditTexts 都是相同的,只是列不同)

    ...
<TableLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="6dp"
android:stretchColumns="*">

<TableRow
android:layout_width="match_parent"
android:layout_height="match_parent">
<EditText
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_column="1"
android:background="@drawable/background"
android:inputType="number"
android:maxLength="3"
android:textAlignment="center"
android:textAppearance="@style/TextAppearance.AppCompat.Medium" />
...

最佳答案

您需要为表格布局中的每个 View 设置 android:layout_width="0dp"和 android:layout_weight="1"

关于java - 如果我按 Enter 或关闭键盘,EditText 会更改大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60580524/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com