Google在android5.0之后推出新设计标准Material Design,为了能在低版本上使用Material Design,google发布了Android Support Design支持库。 下面我们看看该库中提供的一些组件的用法 SnackBar该组件是介于 ...
Google在android5.0之后推出新设计标准Material Design,为了能在低版本上使用Material Design,google发布了Android Support Design支持库。
下面我们看看该库中提供的一些组件的用法
SnackBar该组件是介于Toast和Dialog之间的一种提示信息组件,用法和Toast有点类似。SnackBar中常用的方法如下:
1、public static Snackbar make(@NonNull View view, @StringRes int resId, @Duration int duration):静态方法,使用字符串资源构建一个SnackBar对象
2、public static Snackbar make(@NonNull View view, @NonNull CharSequence text, 具体的布局文件内容如下:<android.support.design.widget.CoordinatorLayout ="http://schemas.android.com/apk/res/android" ="http://schemas.android.com/apk/res-auto" ="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true"> <TextView android:id="@+id/show" android:layout_width="match_parent" android:layout_height="wrap_content" android:textSize="16sp" /> <android.support.design.widget.FloatingActionButton android:id="@+id/btnFloating" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="end|bottom" android:layout_margin="20dp" android:src='/images/loading.gif' data-original="@mipmap/ic_launcher" app:backgroundTint="#ff0000" app:borderWidth="5dp" app:elevation="10dp" app:fabSize="normal" app:pressedTranslationZ="5dp" app:rippleColor="#00ff00" /></android.support.design.widget.CoordinatorLayout>
海外公司注册、海外银行开户、跨境平台代入驻、VAT、EPR等知识和在线办理:https://www.xlkjsw.com
原标题:Android之ASD组件(一)
关键词:Android
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们:
admin#shaoqun.com
(#换成@)。