Android自定義彈出框dialog效果-創(chuàng)新互聯(lián)

項(xiàng)目要用到彈出框,還要和蘋(píng)果的樣式一樣(Android真是沒(méi)地位),所以就自己定義了一個(gè),不是很像(主要是沒(méi)圖),但是也還可以。

創(chuàng)新互聯(lián)于2013年創(chuàng)立,公司以網(wǎng)站設(shè)計(jì)、網(wǎng)站建設(shè)、系統(tǒng)開(kāi)發(fā)、網(wǎng)絡(luò)推廣、文化傳媒、企業(yè)宣傳、平面廣告設(shè)計(jì)等為主要業(yè)務(wù),適用行業(yè)近百種。服務(wù)企業(yè)客戶超過(guò)千家,涉及國(guó)內(nèi)多個(gè)省份客戶。擁有多年網(wǎng)站建設(shè)開(kāi)發(fā)經(jīng)驗(yàn)。為企業(yè)提供專(zhuān)業(yè)的網(wǎng)站建設(shè)、創(chuàng)意設(shè)計(jì)、宣傳推廣等服務(wù)。 通過(guò)專(zhuān)業(yè)的設(shè)計(jì)、獨(dú)特的風(fēng)格,為不同客戶提供各種風(fēng)格的特色服務(wù)。

廢話不多說(shuō)了,直接上代碼

1、先看布局文件

<?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:padding="20dp"
 android:orientation="vertical">

 <LinearLayout
  android:layout_width="match_parent"
  android:layout_height="wrap_content"
  android:gravity="center_horizontal"
  android:background="@drawable/custom_dialog_background"
  android:orientation="vertical">

  <LinearLayout
   android:layout_width="match_parent"
   android:layout_height="wrap_content"
   android:gravity="center_horizontal"
   android:orientation="vertical">

   <TextView
    android:id="@+id/tv_title_custom_dialog"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginTop="20dp"
    android:text="提醒"
    android:textColor="#000"
    android:textSize="18dp" />

   <TextView
    android:id="@+id/tv_message_custom_dialog"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginTop="10dp"
    android:text="您確定要取消訂單嗎" />
  </LinearLayout>

  <View
   android:layout_width="match_parent"
   android:layout_height="0.5dp"
   android:layout_marginTop="20dp"
   android:background="#dfdfdf" />

  <LinearLayout
   android:layout_width="match_parent"
   android:layout_height="wrap_content"
   android:orientation="horizontal">

   <Button
    android:id="@+id/btn_negative_custom_dialog"
    android:layout_width="0dp"
    android:layout_height="wrap_content"
    android:layout_weight="1"
    android:background="@android:color/transparent"
    android:text="取消"
    android:textColor="@android:color/holo_blue_dark" />

   <View
    android:layout_width="0.5dp"
    android:layout_height="match_parent"
    android:background="#dfdfdf" />

   <Button
    android:id="@+id/btn_positive_custom_dialog"
    android:layout_width="0dp"
    android:layout_height="wrap_content"
    android:layout_weight="1"
    android:background="@android:color/transparent"
    android:text="確定"
    android:textColor="@android:color/holo_blue_dark" />
  </LinearLayout>
 </LinearLayout>
</LinearLayout>

當(dāng)前題目:Android自定義彈出框dialog效果-創(chuàng)新互聯(lián)
網(wǎng)站URL:http://www.bm7419.com/article10/dpcpgo.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供ChatGPTApp設(shè)計(jì)、企業(yè)建站、網(wǎng)站策劃、手機(jī)網(wǎng)站建設(shè)標(biāo)簽優(yōu)化

廣告

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

網(wǎng)站建設(shè)網(wǎng)站維護(hù)公司