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

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中文字幕| 日韩精品日本道欧美黄片| 久久好大好爽要死了欧美| 国产黄色片网站在线看| 中文字幕一区免费视频| 日本91一区二区不卡| 日本特黄特色高清免费大片| 美女张开腿让男人插进去 | 亚洲午夜精品久久久天堂| 国产高清视频成人在线观看| 四虎精品免费在线视频| 极品人妻少妇精品一区二区| 国产三级黄在线观看| 亚洲视一区二区三区四区| 蜜桃午夜精品一区二区三区| 日本在线一区二区三区免费视频| 禁止未满十八在线观看| 中文字幕中文字幕久久不卡| 亚洲欧美经典精品专区| 国产精品久久久亚洲不卡| 国产一级特黄大片特爽| 中文字幕乱码伊人三级| 日本人妻在线不卡视频| 亚洲中文字幕激情中午字幕| 国内精品偷拍一区二区三区| av在线免费观看美日韩| 草嫩av一区二区三区| 日韩有码大片最新自拍| 蜜桃一区二区三区免费| 日本韩国视频一区二区| 国产精品国产一级国产av| 日韩av黄色制服在线网站| 国产男女乱淫一区二区三区| 欧美日韩综合在线第一页| 亚洲日本成人一区二区| 国产精品一区欧美精品| 亚洲成人精品青青香蕉| 亚洲欧美精品综合久久99| 人妻久久久久久精品99|