0

プロジェクトで abs を使用しています。マニフェスト ファイルで定義されたアクティビティがあり、Theme.Sherlock.Dialog スタイルを指定しました。これにより、ダイアログがダイアログのように表示されます。ただし、表示されるダイアログは完全な layout_width を埋めますか? 私は何を間違っていますか。これが私のコードです

<activity
        android:name=".activity.ConfirmationDialog"
        android:configChanges="keyboardHidden|orientation"
        android:label="Confirm"
        android:launchMode="standard"
        android:theme="@style/ThemeWithCorners" />

<style name="ThemeWithCorners" parent="Theme.Sherlock.Dialog">
    <item name="android:windowBackground">@drawable/dialog_round_corners</item>
    <item name="android:windowCloseOnTouchOutside">false</item>
</style>


<?xml version="1.0" encoding="utf-8"?>

<TextView
    android:id="@+id/headerText"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_marginBottom="5dp"
    android:layout_marginLeft="10dp"
    android:layout_marginRight="10dp"
    android:layout_marginTop="2dp"
    android:textSize="15sp"
    android:textStyle="bold" />

<TextView
    android:id="@+id/bodyText"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_marginBottom="5dp"
    android:layout_marginLeft="10dp"
    android:layout_marginRight="10dp"
    android:layout_marginTop="10dp"
    android:textSize="15sp"
    android:textColor="@color/black"
    android:textStyle="normal" />

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

    <Button
        android:id="@+id/posotiveButton"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_margin="10dp"
        android:layout_weight="1"
        android:background="@drawable/custom_button_grey"
            android:text="@string/postiveButtonText" />

    <Button
        android:id="@+id/negativeButton"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_margin="10dp"
            android:layout_weight="1"
        android:background="@drawable/custom_button_grey"
        android:text="@string/negativeButtonText" />
</LinearLayout>

4

1 に答える 1

3

ABS\res\layout\abs__dialog_title_holo.xml で次のように変更してみてください

<FrameLayout android:layout_width="wrap_content" 

への変更

<FrameLayout android:layout_width="fill_parent" 

これは私にとってはうまくいきました。

于 2013-12-04T04:39:29.987 に答える