Android Kotlin. Необходимо изменить расположение Hint у messageLayout на верх, сейчас…
- User
Android Kotlin. Необходимо изменить расположение Hint у messageLayout на верх, сейчас Hint находится по середине, как это можно сделать?
<com.google.android.material.card.MaterialCardView android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_margin="@dimen/std_margin" app:contentPadding="@dimen/std_margin"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical"> <ImageView android:layout_width="144dp" android:layout_height="144dp" android:layout_gravity="center_horizontal" android:importantForAccessibility="no" android:src="@drawable/ic_family_account_invite_form" /> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="@dimen/std_half_margin" android:gravity="center" android:text="@string/family_account_invite_form_title_text" android:textAppearance="@style/TextAppearance.Maxi.H3" android:textColor="@color/text_color_on_surface_high" /> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="@dimen/std_margin" android:gravity="center" android:text="@string/family_account_invite_form_description_text" android:textAppearance="@style/TextAppearance.Maxi.Bodytext1" android:textColor="@color/text_color_on_surface_high" /> <ru.maxi.mobile.uikit.components.textfield.TextInputLayout android:id="@+id/phone_layout" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="@dimen/maxi_cardview_margin_bottom" android:hint="@string/family_account_invite_form_phone_hint"> <com.google.android.material.textfield.TextInputEditText android:id="@+id/phone_field" android:layout_width="match_parent" android:layout_height="wrap_content" android:inputType="phone" android:maxLines="1" /> </ru.maxi.mobile.uikit.components.textfield.TextInputLayout> <ru.maxi.mobile.uikit.components.textfield.TextInputLayout android:id="@+id/message_layout" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="@dimen/std_margin" android:hint="@string/family_account_invite_form_message_hint"> <com.google.android.material.textfield.TextInputEditText android:id="@+id/message_field" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="top" android:inputType="textMultiLine" android:maxLength="100" android:maxLines="2" android:minLines="2" android:overScrollMode="ifContentScrolls" android:scrollbarStyle="insideInset" android:scrollbarThumbVertical="@color/borders_dividers_12" android:scrollbars="vertical" /> </ru.maxi.mobile.uikit.components.textfield.TextInputLayout> - Assistant
Для того чтобы сместить подсказку (Hint) в
TextInputLayoutвверх при использовании многострочного , необходимо настроить атрибуты так, чтобы текст и подсказка выравнивались по верхней части поля. В вашем случае, вы уже установили , но подсказка всё равно отображается по центру. Чтобы исправить это, нужно внести следующие изменения в :
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.