igo*_*die 5 android textview android-layout material-design android-textinputedittext
我有以下布局:
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingStart="@dimen/side_margin"
android:paddingTop="@dimen/layout_margin_large"
android:paddingEnd="@dimen/side_margin"
android:paddingBottom="@dimen/layout_margin_default">
<!-- Some oother stuff....-->
<com.google.android.material.textview.MaterialTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/layout_margin_default"
android:text="@string/optional_data" />
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/brand"
android:layout_marginTop="@dimen/layout_margin_default"
app:startIconDrawable="@drawable/baseline_store_24">
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="text" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/model"
android:layout_marginTop="@dimen/layout_margin_default"
app:startIconDrawable="@drawable/baseline_directions_car_24">
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="text" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/build_year"
android:layout_marginTop="@dimen/layout_margin_default"
app:startIconDrawable="@drawable/baseline_event_24">
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="date" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/license_plate"
android:layout_marginTop="@dimen/layout_margin_default"
app:startIconDrawable="@drawable/baseline_pin_24">
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="text" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/vin"
android:layout_marginTop="@dimen/layout_margin_default"
app:startIconDrawable="@drawable/baseline_shield_car_24">
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="text" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/note"
android:layout_marginTop="@dimen/layout_margin_default"
app:startIconDrawable="@drawable/baseline_notes_24">
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textMultiLine"
android:minLines="3"
/>
</com.google.android.material.textfield.TextInputLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
Run Code Online (Sandbox Code Playgroud)
看起来像这样: https: //jmp.sh/v/YgokjVB6XvyHAQqvoFlK
正如您从视频中看到的,我遇到的问题是,当输入最后一个时TextInputEditText,我的整个布局/屏幕开始振动/摇晃,至少当我在前两行时,当输入我的minLine(3 )振动/摇动停止或当我将键盘移动到底线上方一点点时。
删除该minLine属性可以解决问题,但是我想设置最小行数/最小高度,而执行此操作的最佳方法是使用该minLine属性。
我想知道可能是什么问题?可能是因为我的导航栏没有足够的边距吗?
| 归档时间: |
|
| 查看次数: |
71 次 |
| 最近记录: |