原創(chuàng)文章,轉(zhuǎn)載請(qǐng)注明http://blog.csdn.net/leejizhou/article/details/50494634
TextInputLayout是一個(gè)父容器控件荣月,包裹了EditText,也沒(méi)什么特別的屬性仁连,使用很簡(jiǎn)單,切記它一定是和EditText一起搭配使用的改备。
TextInputLayout的常用方法
tl_password.setHint("Username");//EditText獲得焦點(diǎn)后在上面顯示的文字tl_password.setErrorEnabled(true);//開(kāi)啟錯(cuò)誤提醒tl_password.setError("密碼不能為空婴梧!");//錯(cuò)誤提醒的文字tl_password.setErrorEnabled(false);//關(guān)閉錯(cuò)誤提醒
--------------ToolBar------------------
<android.support.v7.widget.Toolbar ? ? ? ??
android:id="@+id/id_toolbar" ? ? ? ?
?app:title="App Title" ? ? ??
? app:subtitle="Sub Title" ? ? ? ??
app:navigationIcon="@drawable/ic_toc_white_24dp" ? ? ? ??
android:layout_height="wrap_content" ? ? ? ??
android:minHeight="?attr/actionBarSize" ? ? ? ??
android:layout_width="match_parent"?
?android:background="?attr/colorPrimary"/>
0................................................rippledrabw? http://www.reibang.com/p/ab2e9a58c119
很簡(jiǎn)單,就是在 drawable 文件夾中定義一個(gè)以為根控件的 xml 文件辨绊,然后作為一個(gè)控件的背景即可奶栖。 定義 ripple_blue.xml :
<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
? ? android:color="#0000cc">
</ripple>
1...........................................................