中文字幕在线观看,亚洲а∨天堂久久精品9966,亚洲成a人片在线观看你懂的,亚洲av成人片无码网站,亚洲国产精品无码久久久五月天

android-cardview簡(jiǎn)單使用

2018-07-20    來(lái)源:open-open

容器云強(qiáng)勢(shì)上線!快速搭建集群,上萬(wàn)Linux鏡像隨意使用

cardview是5.0以上版本的控件,是一個(gè)卡片式布局,繼承framlayout,但是可以使用兼容包老兼容4.0以上的設(shè)備。

測(cè)試環(huán)境是android studio

1.加入依賴:

compile 'com.android.support:cardview-v7:21.0.3'

2.寫(xiě)布局:
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"  
    xmlns:app="http://schemas.android.com/apk/res-auto"  
    android:id="@+id/card_view"  
    android:layout_width="match_parent"  
    android:layout_height="wrap_content"  
    app:cardCornerRadius="4dp"  
    app:cardBackgroundColor="@color/style_color_primary">  
  
    <LinearLayout  
        android:layout_width="match_parent"  
        android:layout_height="wrap_content">  
        <TextView  
            android:layout_width="wrap_content"  
            android:layout_height="wrap_content"  
            android:text="hello cardview!"/>  
    </LinearLayout>  
  
  
</android.support.v7.widget.CardView>

注意:這里有兩個(gè)屬性cardCornerRadius和cardBackgroundColor,已經(jīng)基本上見(jiàn)名知其意了,第一個(gè)是圓角半徑,第二個(gè)是背景顏色。

還有一個(gè)elevator屬性,但是只有在5.0以上版本才能顯示出來(lái)效果啦。

標(biāo)簽:

版權(quán)申明:本站文章部分自網(wǎng)絡(luò),如有侵權(quán),請(qǐng)聯(lián)系:west999com@outlook.com
特別注意:本站所有轉(zhuǎn)載文章言論不代表本站觀點(diǎn)!
本站所提供的圖片等素材,版權(quán)歸原作者所有,如需使用,請(qǐng)與原作者聯(lián)系。

上一篇:用SSLSocketFactory 連接https的地址

下一篇:Android 上拉刷新列表數(shù)據(jù)