【发布时间】:2019-05-30 02:39:37
【问题描述】:
我在“NullPointerException: Attempt to invoke virtual method 'void android.view.View.getBoundsOnScreen(android.graphics.Rect)' on a null object reference”的崩溃日志中发现了崩溃,并且我验证了有关此崩溃的一些 stackoverflow 建议。我发现下面的链接建议在 TextInputLayout 中使用提示而不是 TextInputEditText,所以我想知道它有什么不同?
以下链接建议在 TextInputLayout 中使用提示: SO 谷歌显示在 TextInputEditText 中使用提示: Google_Recommendation
我在 TextInputLayout 和 TextInputEditText 的位置都尝试了提示。提示在这两个地方都同样有效。
我想知道这两种方法有什么区别,哪一种更适合使用。
【问题讨论】:
标签: android android-textinputlayout android-textinputedittext