2017-04-11 4 views
0

Ich versuche Textgröße des Hinweises in TextInputLayout zu erhöhen, während EditText im Fokus ist. Aber nicht in der Lage, herauszufinden, wie man das Gleiche macht.Erhöhen TextInputLayout fokussierte Textgröße

<android.support.design.widget.TextInputLayout 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_marginTop="@dimen/component_margin" 
      > 
       <EditText 
        android:id="@+id/firstName" 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:hint="@string/prompt_first_name" 
        android:maxLines="1" 
        android:textSize="@dimen/normal_text" 
        android:maxLength="25" 
        android:theme="@style/EditTextTheme" 
        /> 
</android.support.design.widget.TextInputLayout> 

dimens.xml

<dimen name="normal_text">14sp</dimen> 

styles.xml

<style name="EditTextTheme"> 
     <item name="colorControlNormal">@color/colorPrimary</item> 
     <item name="android:labelTextSize">@dimen/input_text_size</item> 
</style> 

I Größe von E-Mail für größere Bildschirmgeräte in Bild gezeigt erhöhen möchten.

enter image description here

Ebenso für Passwort

enter image description here

+0

Versuchen Sie, diese in xml 'android: textAppearance = "@ style/Base.TextAppearance.AppCompat.Medium" ' – Nilabja

+0

versucht, dies mit Medium, Large. Aber hatte keinen Effekt in der Ausgabe. – Stallion

Antwort

1

Sie die Standard-hintTextAppearance für TextInputLayout verwenden können. Arbeiten gut für mich

<android.support.design.widget.TextInputLayout 
     android:id="@+id/input_Email" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_below="@+id/ivLogoLogin" 
     app:hintTextAppearance="@style/TextAppearance.AppCompat.Medium"> 
0

Fügen Sie diese auf Ihre Stile:

<style name="InputTextLabel" parent="TextAppearance.Design.Hint"> 
    <item name="android:textSize">16sp</item> 
</style> 

Und dann TextInputLayout in Ihrem Layout-Datei sollte wie folgt aussehen:

<android.support.design.widget.TextInputLayout 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      app:hintTextAppearance="@style/InputTextLabel" 
      android:minHeight="30dp"> 
+0

Versucht, aber hat nicht funktioniert. Die Ausgabe ist gleich. Mein Aktivitätsthema ist