2

シナリオ: メインレイアウトを実行しています。「ヘルプ」ボタンをクリックすると、ダイアログが表示されます。ヘルプダイアログを閉じます。メイン画面には2つのボタンがありますが、これらのボタンは壊れています(グラフィックが間違っています)。

画面のスクリーンショットに、まだ完成していないボタンを添付しています(悪いボタンは「連絡先の検索」と「呼び出し」です)。

問題は、明らかに、メイン画面のグラフィックに影響を与えずにダイアログを閉じるにはどうすればよいですか? ダイアログが消えた後のボタンの悪い画面

メイン画面のレイアウト

<LinearLayout 
    xmlns:android           = "http://schemas.android.com/apk/res/android"
    android:layout_width    = "fill_parent"
    android:layout_height   = "fill_parent"
    android:paddingLeft     = "@dimen/general_logo_padding"
    android:paddingRight    = "@dimen/general_logo_padding"
    android:orientation     = "vertical"
    android:background      = "@drawable/login_background" >


        <!-- Logo -->
        <ImageView    
            android:id                  = "@+id/imgLogo"
            android:src                 = "@drawable/emobile_logo10"
            android:contentDescription  = "@string/login_imgdescriptor_logo"
            android:layout_width        = "fill_parent"
            android:layout_height       = "wrap_content"
            android:layout_marginTop    = "@dimen/callback_logo_margin"
            android:scaleType           = "fitStart" 
            android:layout_weight       = "0.1"/>


        <!-- Callback Fields -->
        <!-- Your Number -->
        <LinearLayout 
            xmlns:android               = "http://schemas.android.com/apk/res/android"
            android:layout_width        = "fill_parent"
            android:layout_height       = "wrap_content"
            android:orientation         = "horizontal" 
            android:layout_marginTop    = "@dimen/callback_yournumber_margin" 
            android:layout_weight       = "0.2">

            <TextView
                android:id              = "@+id/tvCBYournumber"
                android:layout_width    = "fill_parent"
                android:layout_height   = "wrap_content"
                android:text            = "@string/callback_btn_yournumber"
                android:textAppearance  = "?android:attr/textAppearanceMedium"
                android:textSize        = "@dimen/login_fields_text_size" 
                android:textColor       = "#F26A05" 
                android:layout_weight   = "6"/>

            <EditText 
                android:id                  = "@+id/etCBYourNumber"
                android:layout_height       = "wrap_content"
                android:layout_width        = "fill_parent"
                android:inputType           = "number"
                android:ellipsize           = "end"
                android:singleLine          = "true"
                android:minHeight           = "@dimen/edittext_min_height"
                android:background          = "@drawable/edittext_round_corners"        
                android:gravity             = "center"
                android:textAppearance      = "?android:attr/textAppearanceMedium"
                android:textSize            = "@dimen/login_fields_text_size" 
                android:layout_weight       = "4" />
        </LinearLayout>

        <!-- Connect To -->
        <LinearLayout 
            xmlns:android               = "http://schemas.android.com/apk/res/android"
            android:layout_width        = "fill_parent"
            android:layout_height       = "wrap_content"
            android:layout_marginTop    = "@dimen/callback_connectto_margin"
            android:orientation         = "horizontal" 
            android:layout_weight       = "0.2">

            <TextView
                android:id              = "@+id/tvCBConnectto"
                android:layout_width    = "fill_parent"
                android:layout_height   = "wrap_content"
                android:text            = "@string/callback_btn_connectto"
                android:textAppearance  = "?android:attr/textAppearanceMedium"
                android:textSize        = "@dimen/login_fields_text_size" 
                android:textColor       = "#F26A05" 
                android:layout_weight   = "6"/>

            <EditText 
                android:id                  = "@+id/etCBConnectTo"
                android:layout_height       = "wrap_content"
                android:layout_width        = "fill_parent"
                android:inputType           = "number"
                android:ellipsize           = "end"
                android:singleLine          = "true"
                android:minHeight           = "@dimen/edittext_min_height"
                android:background          = "@drawable/edittext_round_corners"        
                android:gravity             = "center"
                android:textAppearance      = "?android:attr/textAppearanceMedium"
                android:textSize            = "@dimen/login_fields_text_size" 
                android:layout_weight       = "4"/>
        </LinearLayout>

        <!-- Line of Buttons -->
        <LinearLayout 
            xmlns:android               = "http://schemas.android.com/apk/res/android"
            android:layout_width        = "fill_parent"
            android:layout_height       = "wrap_content"
            android:orientation         = "horizontal" 
            android:layout_marginTop    = "@dimen/callback_button_margin" 
            android:minHeight           = "@dimen/callback_button_height"
            android:layout_weight       = "0.1">

            <Button
                android:id                  = "@+id/btnCBSearchContacts"
                android:layout_width        = "fill_parent"
                android:layout_height       = "fill_parent"
                android:text                = "@string/callback_btn_searchcontacts" 
                android:textSize            = "@dimen/login_fields_text_size" 
                android:drawableLeft        = "@android:drawable/ic_menu_my_calendar"
                android:layout_weight       = "1" />

            <Button
                android:id                  = "@+id/btnCBCall"
                android:layout_width        = "fill_parent"
                android:layout_height       = "fill_parent"
                android:text                = "@string/callback_btn_call" 
                android:layout_marginLeft   = "@dimen/callback_button_margin_betweenbuttons"
                android:textSize            = "@dimen/login_fields_text_size" 
                android:drawableLeft        = "@android:drawable/ic_menu_call"
                android:layout_weight       = "1" />

        </LinearLayout>                        

        <RelativeLayout 
            xmlns:android               = "http://schemas.android.com/apk/res/android"
            android:layout_width        = "fill_parent"
            android:layout_height       = "fill_parent" 
            android:layout_weight       = "3">

            <Button
                android:id                      = "@+id/btnCBHelp"
                android:layout_width            = "wrap_content"
                android:layout_height           = "wrap_content"
                android:padding                 = "@dimen/callback_button_help_padding"
                android:text                    = "@string/callback_btn_help" 
                android:layout_centerInParent   = "true"
                android:textSize                = "@dimen/login_fields_text_size" 
                android:drawableLeft            = "@android:drawable/ic_menu_help" />
        </RelativeLayout>

</LinearLayout>
4

2 に答える 2

0

AlertDialogを使用して新しいレイアウトをポップアップし、Androidのドキュメントも表示します

ありがとう。

于 2012-10-23T09:17:45.627 に答える
0

さて、私は問題を見つけました。

問題は、ボタンの作成に使用するライブラリにあるようです。これは非常に初期のベータ段階であり、何らかの理由でこの問題が発生します。

Pixateライブラリを使用しています

LayoutInflaterを使用するようにコードを微調整しました(Parth Doshiのアイデア-ありがとう)。Dialogを拡張する代わりに、Alertダイアログ(Md Abdul Gafur)を使用しています。これらの2つの方法を使用すると、問題は軽減されますが、解決されません。

チャイアビ、ありがとうございました。

于 2012-10-24T09:23:41.400 に答える