簡體   English   中英

如何在Android中為警報對話框標題添加焦點

[英]How to add Focus for Alert Dialog Title in Android

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android orientation="vertical" >

    <TextView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="@string/hello" />

    <Button
        android:id="@+id/button1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="xyz" />
    <EditText 
           android:id="@+id/editText1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"

        />
</LinearLayout>

我有一個上面的XML布局,當我單擊那個xyz按鈕時,我想啟動我的應用程序“ Sample App”,該應用程序將顯示一個對話框。 我已經通過設置->輔助功能啟用了“對講”應用程序。 然后,一旦我單擊xyz按鈕,對講應用就會說“ alert ..”,而不是“ alert +對話框標題”。 但是,如果我在應用程序中啟動對話框,則其正確顯示對話框標題。

以清單形式聲明您的活動。

<activity
        android:name=".ActivityName"           
        android:theme="@android:style/Theme.Dialog" >

暫無
暫無

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

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