how to set floating label text size?
The accepted answer helped me a lot to find my solution (i.e. setting the exact font size, not only using small, medium, ...).
In addition, by defining a style for app:hintTextAppearance, you can also simply set the color of floating label :)
in styles.xml:
<style name="CustomTextAppearance" parent="@android:style/TextAppearance">
<item name="android:textSize">16sp</item>
<item name="android:textColor">@color/colorAccent</item>
</style>
and in your TextInputLayout:
<android.support.design.widget.TextInputLayout
android:id="@+id/lyt_goal"
style="@style/CustomTextInput"
app:hintTextAppearance="@style/CustomTextAppearance">
<android.support.v7.widget.AppCompatEditText
android:id="@+id/edt_goal"
android:hint="@string/str_goal" />
Try following code. This may help you:
<android.support.design.widget.TextInputLayout
android:id="@+id/input_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:hintTextAppearance="@style/TextAppearance.AppCompat.Medium.Inverse">
You may use app:hintTextAppearance="@style/TextAppearance.AppCompat.Small.Inverse"
instead.