Can`t inflate layout with TextInputLayout or how to change hint size in TextInputLayout?

75 views
Skip to first unread message

Sania Sutula

unread,
Nov 5, 2015, 10:17:39 AM11/5/15
to macroid
I need to change size of the hint. But i can do it only using styles. There is no way to do it, because i don`t have access to textHintAppereance. So i need to declare it in xml and then use: 

text_input_layout.xml:

<android.support.design.widget.TextInputLayout
android:layout_height="wrap_content"
android:layout_width="match_parent">

<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Password"/>
</android.support.design.widget.TextInputLayout>

in activity:

Ui(inflater.inflate(R.layout.text_input_layout, null))

And when i use it, i get an error: 
ClassNotFoundException: android.view.TextInputLayout


But, when i try to declare using DSL it works fine:
l[TextInputLayout](
w[AppCompatEditText] <~ wire(etPassword) <~ hint("Password")
) <~ vMatchWidth,


And when i setContentView from xml layout setContentView(R.layout.test_layout) with TextInputLayout - it works fine.

So, can i do this action using DSL or i need to use vanilla Android way for screens with TextInputLayout?
Reply all
Reply to author
Forward
0 new messages