Android的錯誤Text_Input_Layout EDITTEXT
有誰知道我可以改變(如所附的圖像)錯誤浮動標籤的部分提到的位置?在圖片中,它在左邊,但我希望它位於edittext的右側(因爲我的母語)。我嘗試了重力和佈局重力,但沒有一個能解決問題。提前致謝 。
<android.support.design.widget.TextInputLayout
android:id="@+id/numid"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
app:errorEnabled="true"
app:errorTextAppearance="@style/myerror"
android:layout_gravity="center"
app:hintTextAppearance="@style/TextAppearance.AppCompat.TextInputLayout"
style="@style/EditScreenTextInputLayoutStyle">
<android.support.v7.widget.AppCompatEditText
android:id="@+id/tie"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:inputType="number"
android:gravity="right"
android:textAlignment="gravity"
android:hint="@string/hint2"
android:textDirection="rtl"
/>
<style name="TextAppearance.AppCompat.TextInputLayout" parent="@android:style/TextAppearance">
<item name="android:textColor">#ff0000</item>
<item name="android:layout_gravity">right</item>
<item name="android:textColorHint">#736f6e</item>
<item name="android:gravity">right</item>
<style name="EditScreenTextInputLayoutStyle" parent="Theme.AppCompat.Light">
<item name="colorControlNormal">#000</item>
<item name="colorControlActivated">#000</item>
<item name="colorControlHighlight">#ff0000</item>
<item name="colorAccent">#ffff02</item>
<item name="android:textColorHint">#0000ff</item>
</style>
<style name="myerror" parent="TextAppearance.Design.Error">
<item name="android:textColor">#ff0000</item>
<item name="android:background">#000000</item>
<item name="android:gravity">center</item>
</style>
分享您的佈局文件。 – buzzingsilently
'android:supportsRtl' ????? –
@IntelliJ Amiya。 getWindow()。getDecorView()。setLayoutDirection(View.Layout_Di rection_RTL)。我如何將它用於edittext? –