support design开发控件

来源:互联网 发布:redis mac 客户端 编辑:程序博客网 时间:2024/06/09 23:43
xml:
FloatingActionButton
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"    xmlns:app="http://schemas.android.com/apk/res-auto"    xmlns:tools="http://schemas.android.com/tools"    android:layout_width="match_parent"    android:layout_height="match_parent"    android:orientation="vertical"    android:paddingBottom="@dimen/activity_vertical_margin"    android:paddingLeft="@dimen/activity_horizontal_margin"    android:paddingRight="@dimen/activity_horizontal_margin"    android:paddingTop="@dimen/activity_vertical_margin"    tools:context=".MainActivity">    <TextView        android:layout_width="wrap_content"        android:layout_height="wrap_content"        android:text="@string/hello_world" />    <android.support.design.widget.FloatingActionButton        android:id="@+id/search_close_btn"        android:layout_width="wrap_content"        android:layout_height="wrap_content"        android:src="@drawable/abc_ic_menu_share_mtrl_alpha"        app:backgroundTint="#00ffff"        app:elevation="10dp"        app:fabSize="normal" />    <android.support.design.widget.TextInputLayout        android:id="@+id/textinput"        android:layout_width="fill_parent"        android:layout_height="wrap_content">        <EditText            android:layout_width="fill_parent"            android:layout_height="wrap_content" />    </android.support.design.widget.TextInputLayout>
 
</LinearLayout>
/*
* SnackBar   
 
TextInputLayout:其中必须填充一个editview,否则没有意义
*/
0 0
原创粉丝点击