前言
本文主要給大家介紹了關(guān)于Android自定義升級對話框的相關(guān)內(nèi)容,分享出來供大家參考學(xué)習(xí),下面話不多說了,來一起看看詳細的介紹吧。
實現(xiàn)的效果如下所示
其實這也只是一個DialogFragment 而已,重點只是在于界面的設(shè)計
想要使用做出這樣一個DialogFragment ,需要自定義一個View,然后將該View傳入到該Dialog中
先定義布局,一個TextView用于標題,一個TextView用于升級內(nèi)容闡述,一個ImageView,一個確認升級的按鈕
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <TextView android:id="@+id/tv_title" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="20dp" android:gravity="center" android:textColor="#0474dc" android:textSize="22sp" android:textStyle="bold" /> <TextView android:id="@+id/tv_description" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="15dp" android:gravity="center" android:textColor="#0474dc" android:textSize="18sp" /> <ImageView android:layout_width="70dp" android:layout_height="70dp" android:layout_gravity="center" android:layout_marginBottom="20dp" android:layout_marginTop="20dp" android:src="@drawable/upgrade" /> <Button android:id="@+id/btn_upgrade" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginBottom="20dp" android:layout_marginEnd="20dp" android:layout_marginStart="20dp" android:gravity="center" android:text="立即更新" /> </LinearLayout>
新聞名稱:Android如何自定義升級對話框示例詳解-創(chuàng)新互聯(lián)
網(wǎng)站地址:http://aaarwkj.com/article4/idsie.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站建設(shè)、虛擬主機、自適應(yīng)網(wǎng)站、網(wǎng)站設(shè)計、軟件開發(fā)、服務(wù)器托管
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容