我使用TextInputLayout有對AppCompatEditText自定義XML的基於形狀的背景AppCompatEditText。每當我設置一些錯誤,錯誤行從佈局開始。有沒有什麼辦法給這個錯誤線填充。TextInputLayout錯誤文本填充
4
A
回答
0
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:id="@+id/tx_in_username"
android:errorEnabled="true"
android:layout_marginLeft="@dimen/margin_LEFT_RIGHT"
android:layout_marginRight="@dimen/margin_LEFT_RIGHT"
android:layout_height="wrap_content">
<EditText
android:layout_width="match_parent"
android:layout_marginTop="10dp"
android:layout_height="36sp"
android:hint="Username"
/>
+0
不要使用marginLeft和marginRight – Mallikarjuna
2
您可以通過使用引用錯誤的TextView:
TextView textView = (TextView) inputLayout.findViewById(android.support.design.R.id
.textinput_error);
然後你就可以得到它的佈局PARAMS的工作。
相關問題
- 1. #姓名?錯誤填充文本控件
- 2. 如何禁用TextInputLayout上的填充?
- 3. 用TextInputLayout填充整個屏幕區域
- 4. Chrome自動填充正在填寫錯誤的文本輸入
- 5. TextInputLayout錯誤對齊
- 6. Rijndael填充錯誤
- 7. 填充UILabel文本填充其寬度
- 8. TextInputLayout錯誤消息大小
- 9. 變化TextInputLayout錯誤字體?
- 10. FF4中的填充錯誤
- 11. 錯誤div未被填充
- 12. Laravel5填充選擇錯誤
- 13. 錯誤填充的ObservableCollection
- 14. 填充錯誤 - 在C
- 15. HTML DIV填充錯誤
- 16. 底部填充div錯誤
- 17. 填充順序錯誤
- 18. 的Android CardView填充錯誤
- 19. 錯誤填充c#數組
- 20. 陣列填充錯誤
- 21. 從DropDownList填充文本框選擇用CascadingDropDown填充本身
- 22. TextInputLayout文本區域 - 安卓
- 23. 填充ASP文本框
- 24. 用jQuery填充文本框
- 25. TextView.SetMaxLines填充文本n行
- 26. 帆布填充文本
- 27. 與XmlNode.Attributes填充文本框
- 28. 自動填充文本框
- 29. 自動填充文本框
- 30. 填充文本框與
參考http://stackoverflow.com/questions/32609710/textinputlayout-how-to-give-padding-or-margin-to-hint – sasikumar
你能用你試過的代碼更新這個問題嗎? – Kae10
使用'setError(null)' –