Cómo cambiar el tamaño de sugerencia de TextInputLayout
Este es mi xml
<android.support.design.widget.TextInputLayout
style="@style/main_input_text"
android:layout_marginTop="@dimen/activity_medium_margin"
app:hintTextAppearance="@style/TextAppearence.App.TextInputLayout">
<android.support.v7.widget.AppCompatEditText
style="@style/main_edit_text"
android:inputType="text" />
</android.support.design.widget.TextInputLayout>
Y esto es estilo
<style name="main_input_text">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">@dimen/activity_edittext_height</item>
<item name="android:background">@drawable/mc_shape_border_button_transparent</item>
<item name="android:gravity">center_vertical</item>
<item name="android:paddingTop">@dimen/activity_extra_small_margin</item>
<item name="android:paddingBottom">@dimen/activity_extra_small_margin</item>
<item name="android:keyTextSize">8sp</item>
<item name="android:textSize">8sp</item>
</style>
No encuentro que algo como hintSize, textSize y keyTextSize no ayude
34
Author: Ara Badalyan, 2015-09-29
5 answers
En sus estilos.xml
<style name="TextLabel" parent="TextAppearance.Design.Hint">
<item name="android:textSize">16sp</item>
</style>
Y luego en su archivo de diseño:
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/activity_horizontal_margin"
android:layout_marginRight="@dimen/activity_horizontal_margin"
android:layout_marginTop="12dp"
app:hintTextAppearance="@style/TextLabel"
android:minHeight="30dp">
85
Author: Santiago Martínez,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-09-29 07:36:21
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-09-29 07:36:21
Cambia el app:errorTextAppearance
de TextInputLayout en XML.
<android.support.design.widget.TextInputLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:errorTextAppearance="@style/CustomTextInputLayoutStyle.ErrorTextStyle">
Donde CustomTextInputLayoutStyle.ErrorTextStyle
se define en styles.xml
como
<style name="CustomTextInputLayoutStyle.ErrorTextStyle" parent="TextAppearance.Design.Error">
<item name="android:textSize">10sp</item>
</style>
4
Author: nt-complete,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2015-11-20 00:31:07
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2015-11-20 00:31:07
1) Añadir hintTextAppearance
a su InputLayout con un estilo
<android.support.design.widget.TextInputLayout xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:hintTextAppearance="@style/TextInputLayoutHintText" >
<android.support.design.widget.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="16sp" />
</android.support.design.widget.TextInputLayout>
2) Luego simplemente agregue el estilo a sus estilos.xml
<style name="TextInputLayoutHintText">
<item name="android:textColor">@color/gray</item>
<item name="android:textSize">12sp</item></style>
1
Author: password,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-01-12 18:03:01
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-01-12 18:03:01
@Santiago Martínez respuesta solo funciona para sugerencias en no vacío Edittext
(dentro TextInputLayout
)
Pero para vacío Edittext
, TextInputLayout
pista toma propiedad de Edittext
textSize
.
0
Author: Neeraj Bagra,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-10-04 02:43:39
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-10-04 02:43:39
Puede reducir el tamaño de la fuente en el EditText, lo que también reducirá el tamaño de la sugerencia. es decir, android:textSize="16sp"
-2
Author: Gopi Krishna,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2015-09-29 12:09:08
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2015-09-29 12:09:08