gpt4 book ai didi

android - TextInputLayout 为某些设备自动隐藏

转载 作者:行者123 更新时间:2023-11-30 00:08:04 27 4
gpt4 key购买 nike

我添加了 7+ TextInpuLayout 和父级 ScrollView 并且 TextInputLayout 在某些设备上只显示第一个后隐藏并且对于某些设备它工作得很好。为了更好地理解,这里有两个屏幕截图

适用于少数设备 enter image description here

but hides automatically like this

但是这样会自动隐藏

我正在使用 实现 'com.android.support:design:26.1.0'
用于设计库。

这是布局文件

    <?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
android:orientation="vertical"
android:scrollbars="vertical"
tools:context="clockworktt.gaby.com.GuestProfileActivity">

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">


<android.support.design.widget.AppBarLayout
android:id="@+id/appBarLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content">

<include
android:id="@+id/guest_profile_toolbar"
layout="@layout/app_bar_layout"></include>

</android.support.design.widget.AppBarLayout>


<LinearLayout
android:layout_width="match_parent"
android:layout_height="150dp"
android:layout_marginTop="?android:attr/actionBarSize"
android:background="@color/colorPrimary"
android:gravity="center"
android:orientation="vertical">

<de.hdodenhof.circleimageview.CircleImageView
android:id="@+id/guest_profile_image"
android:layout_width="90dp"
android:layout_height="90dp"
android:src="@drawable/ic_avatar" />

<TextView
android:id="@+id/guest_profile_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="Guest Name"
android:textAlignment="center"
android:textColor="@color/almostWhite"
android:textSize="18sp" />

</LinearLayout>


<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="210dp"
android:orientation="vertical">

<android.support.design.widget.TextInputLayout
android:id="@+id/profile_name_input_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp">

<android.support.design.widget.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Name"
android:paddingLeft="10dp"
android:singleLine="true"
android:textColor="@color/colorPrimaryDark"
android:textSize="14sp" />
</android.support.design.widget.TextInputLayout>



<android.support.design.widget.TextInputLayout
android:id="@+id/profile_salutation_input_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp">

<android.support.design.widget.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Salutation"
android:paddingLeft="10dp"
android:singleLine="true"
android:textColor="@color/colorPrimaryDark"
android:textSize="14sp" />
</android.support.design.widget.TextInputLayout>



<android.support.design.widget.TextInputLayout
android:id="@+id/profile_email"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp">

<android.support.design.widget.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Email"
android:inputType="textEmailAddress"
android:paddingLeft="10dp"
android:singleLine="true"
android:textColor="@color/colorPrimaryDark"
android:textSize="14sp" />
</android.support.design.widget.TextInputLayout>



<android.support.design.widget.TextInputLayout
android:id="@+id/profile_occupation"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
>

<android.support.design.widget.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Occupation"
android:paddingLeft="10dp"
android:singleLine="true"
android:textColor="@color/colorPrimaryDark"
android:textSize="14sp" />
</android.support.design.widget.TextInputLayout>

<android.support.design.widget.TextInputLayout
android:id="@+id/profile_company"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp">

<android.support.design.widget.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Company"
android:paddingLeft="10dp"
android:singleLine="true"
android:textColor="@color/colorPrimaryDark"
android:textSize="14sp" />
</android.support.design.widget.TextInputLayout>




<android.support.design.widget.TextInputLayout
android:id="@+id/profile_phone"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp">

<android.support.design.widget.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Phone"
android:inputType="numberDecimal"
android:paddingLeft="10dp"
android:singleLine="true"
android:textColor="@color/colorPrimaryDark"
android:textSize="14sp" />

</android.support.design.widget.TextInputLayout>

<android.support.design.widget.TextInputLayout
android:id="@+id/profile_expected_numbers"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp">

<android.support.design.widget.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Expected Numbers"
android:inputType="phone"
android:paddingLeft="10dp"
android:singleLine="true"
android:textColor="@color/colorPrimaryDark"
android:textSize="14sp" />
</android.support.design.widget.TextInputLayout>

<android.support.design.widget.TextInputLayout
android:id="@+id/profile_notes"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp">

<android.support.design.widget.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:hint="Notes"
android:inputType="textShortMessage"
android:maxLines="3"
android:paddingLeft="10dp"
android:textColor="@color/colorPrimaryDark"
android:textSize="14sp" />
</android.support.design.widget.TextInputLayout>


<Button
android:id="@+id/profile_update_button"
android:layout_width="match_parent"
android:layout_alignParentBottom="true"
android:layout_height="wrap_content"
android:text="Update"
android:background="@color/colorAccent"
android:textAllCaps="false"
android:textColor="@color/almostWhite"/>

</LinearLayout>



</RelativeLayout>

</ScrollView>

请有人帮忙。谢谢

最佳答案

尝试将 TextInputLayout 的 layout_height 属性设置为 wrap_content

关于android - TextInputLayout 为某些设备自动隐藏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48632424/

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