欧美一级特黄大片做受成人-亚洲成人一区二区电影-激情熟女一区二区三区-日韩专区欧美专区国产专区

Android中怎么利用CardView控件實現(xiàn)卡片效果

今天就跟大家聊聊有關Android中怎么利用CardView控件實現(xiàn)卡片效果,可能很多人都不太了解,為了讓大家更加了解,小編給大家總結了以下內容,希望大家根據(jù)這篇文章可以有所收獲。

創(chuàng)新互聯(lián)公司專注于成都網站建設服務及定制,我們擁有豐富的企業(yè)做網站經驗。 熱誠為您提供成都營銷型網站建設,成都網站制作、成都網頁設計、成都網站官網定制、微信小程序開發(fā)服務,打造成都網絡公司原創(chuàng)品牌,更為您提供成都網站排名全網營銷落地服務。

1.添加依賴

implementation 'com.android.support:cardview-v7:25.3.1'

2.主界面設置一些卡片的屬性:

package com.example.admin.ztest; import android.support.v7.app.AppCompatActivity;import android.os.Bundle;import android.support.v7.widget.CardView;/*app:cardBackgroundColor這是設置背景顏色 app:cardCornerRadius這是設置圓角大小 app:cardElevation這是設置z軸的陰影 app:cardMaxElevation這是設置z軸的最大高度值 app:cardUseCompatPadding是否使用CompatPadding app:cardPreventCornerOverlap是否使用PreventCornerOverlap app:contentPadding 設置內容的padding app:contentPaddingLeft 設置內容的左padding app:contentPaddingTop 設置內容的上padding app:contentPaddingRight 設置內容的右padding app:contentPaddingBottom 設置內容的底padding */ public class MainActivity extends AppCompatActivity {  CardView cardView;   @Override  protected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.activity_first);    cardView = (CardView) findViewById(R.id.cardView);    cardView.setRadius(8);//設置圖片圓角的半徑大小    cardView.setCardElevation(8);//設置陰影部分大小    cardView.setContentPadding(5, 5, 5, 5);//設置圖片距離陰影大小  }}

布局頁面:

<?xml version="1.0" encoding="utf-8"?><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/cardView"  android:layout_width="match_parent"  android:layout_height="match_parent"  android:layout_margin="10dp"  app:cardCornerRadius="8dp">    <LinearLayout    android:layout_width="600pt"    android:layout_height="100pt"    android:background="@drawable/bg_battery_detail"    android:orientation="vertical">     <RelativeLayout      android:layout_width="match_parent"      android:layout_height="match_parent"      android:layout_marginLeft="5dp"      android:layout_marginRight="5dp"      android:layout_marginTop="5dp"      android:background="#184467">       <LinearLayout        android:layout_width="match_parent"        android:layout_height="wrap_content"        android:layout_centerInParent="true"        android:orientation="horizontal">         <TextView          android:id="@+id/tvBatteryNo"          android:layout_width="wrap_content"          android:layout_height="wrap_content"          android:layout_centerVertical="true"          android:text="電池編號"          android:textColor="@color/color_z2"          android:textSize="20sp" />         <TextView          android:id="@+id/tvBatterySlotNo"          android:layout_width="wrap_content"          android:layout_height="wrap_content"          android:layout_centerVertical="true"          android:layout_marginLeft="15pt"          android:text="@string/app_name"          android:textColor="@color/white"          android:textSize="20sp" />      </LinearLayout>       <ImageView        android:id="@+id/ivCloseDialog"        android:layout_width="39pt"        android:layout_height="39pt"        android:layout_alignParentRight="true"        android:layout_centerVertical="true"        android:layout_marginRight="8pt"        android:padding="7pt"        android:src="@mipmap/popup_del" />     </RelativeLayout>    </LinearLayout>  </android.support.v7.widget.CardView>

看完上述內容,你們對Android中怎么利用CardView控件實現(xiàn)卡片效果有進一步的了解嗎?如果還想了解更多知識或者相關內容,請關注創(chuàng)新互聯(lián)行業(yè)資訊頻道,感謝大家的支持。

分享標題:Android中怎么利用CardView控件實現(xiàn)卡片效果
轉載注明:http://www.aaarwkj.com/article48/igjdep.html

成都網站建設公司_創(chuàng)新互聯(lián),為您提供全網營銷推廣、品牌網站設計、網頁設計公司、網站內鏈企業(yè)建站、自適應網站

廣告

聲明:本網站發(fā)布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內容未經允許不得轉載,或轉載時需注明來源: 創(chuàng)新互聯(lián)

網站托管運營
精品亚洲一区二区三区四区| 欧美亚洲另类在线第一页| 成人免费在线视频不卡| 特黄一级黄色大片免费看| 一区二区三区在线观看日韩| 国产精品粗又长一区| 久久香蕉国产线看观看av| 亚洲精品国产熟女av| 国产九色91中文在线视频| 小黄片视频免费在线播放| 极品大胸美女被啪啪的高潮 | 亚洲成人黄色在线网站| 国产传媒剧情剧资源网站| 国产免费成人午夜免费视频| 亚洲一区二区三区香蕉不卡| 亚洲一区二区日本久久| 亚洲一区二区三区精品福利| 五十路八十路息与子交尾| 中文字幕一区二区三区三级| 说中文字幕的黄色大网站| 日韩精品国产专区一区| 国产美女主播视频一区二区三区| 一区二区视频精品在线观看| 日韩免费毛片在线观看| 亚洲精品不卡一区二区| 后入蜜桃臀美女在线观看| 日韩av一区三区在线| 日韩欧美亚洲制服丝袜| 国产成人公开免费视频| 在线观看91高清视频| 欧美日韩成人精品一区二区| 99精品午夜福利在线| 综合久久精品亚洲天堂| 日韩免费av在线网站| 性生活真实视频免费看| 精品欧美不卡在线播放| 青青草国产成人自拍视频在线观看 | 国产大神91一区二区三区| 十八禁无遮挡污污污网站| 国产区二区三区在线视频| 中文字幕日韩精品亚洲精品|