簡體   English   中英

自定義警報對話框

[英]Custom Alert Dialog

自定義警報對話框

如何使用對話框類在自定義警報對話框中設置xml布局的大小(作為模擬對話框)? 我想增加對話框xml布局的大小嗎?如何設置警報框的大小?

`Dialog dialog = new Dialog(context);
        dialog.setContentView(R.layout.extra);
        Button btnSubmit = (Button) findViewById(R.id.btnSubmit);
        dialog.setTitle("Just Dial");
        dialog.setCancelable(true);
        dialog.show();

您的問題已在此處介紹: 在android中控制警報對話框的大小 試一試解決方案。

您在R.layout.extra中嘗試This Xml

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:minWidth="250dp"
    android:minHeight="550dp">

        </RelativeLayout>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM