Ad
Remove Extra Padding/margin From TextInputLayout SetError Text
I am using TextInputLayout to show error with EditText. All is working good. I have to remove extra space from TextInputLayout's error text.
So far I had did this,
<android.support.design.widget.TextInputLayout
android:id="@+id/txt_error_passowrd"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
app:errorEnabled="true"
app:passwordToggleEnabled="true"
app:passwordToggleTint="@color/colorAccent"
app:errorTextAppearance="@style/error_appearance"
app:hintTextAppearance="@style/EditHintText">
<android.support.design.widget.TextInputEditText
android:id="@+id/edit_password"
android:layout_width="match_parent"
android:layout_height="@dimen/views_height"
android:fontFamily="@font/roboto_light"
android:hint="@string/password"
android:inputType="textPassword"
android:paddingLeft="10dp"
android:textColorHint="@color/light_text_color"
android:textSize="@dimen/font_14sp" />
</android.support.design.widget.TextInputLayout>
And inside style.xml I had use this
<style name="EditHintText" parent="TextAppearance.Design.Hint">
<item name="android:textSize">@dimen/font_10sp</item>
<item name="android:textColor">@color/dark_text_color</item>
</style>
<style name="error_appearance" parent="@android:style/TextAppearance">
<item name="android:textColor">@color/red</item>
<item name="android:textSize">@dimen/font_10sp</item>
</style>
Ad
Answer
Try removing this line android:paddingLeft=10dp from TextInputEditText, as there is no padding in TextInputLayout this EditText padding may be causing the problem also why are you using android:layout_weight=1 for TextInputLayout when none of its height or width is set to 0dp.
Ad
source: stackoverflow.com
Related Questions
- → should I choose reactjs+f7 or f7+vue.js?
- → Phonegap Android write to sd card
- → Local reference jquery script in nanohttpd (Android)
- → Click to navigate on mobile devices
- → How to allow api access to android or ios app only(laravel)?
- → Access the Camera and CameraRoll on Android using React Native?
- → React native change listening port
- → What is the default unit of style in React Native?
- → Google play market autocomplete icon
- → Warning: Each child in an array or iterator should have a unique "key" prop. Check the render method of `ListView`
- → Using Laravel with Genymotion
- → react native using like web-based ajax function
- → react native pdf View
Ad