Defining android activity as dialog with light theme

后端 未结 4 1050
刺人心
刺人心 2021-01-13 21:58

In my application I am defining one android activity as dialog.It looks proper.Only problem with that is my dialog appear in dark theme. I want to display it into light them

相关标签:
4条回答
  • 2021-01-13 22:08

    This also have worked for me. I have my app theme applied for the dialog activity.

    <style name="Theme.UserDialog" parent="@style/MyAppTheme">
        <item name="android:windowFrame">@null</item>
        <item name="android:windowIsFloating">true</item>
        <item name="android:windowIsTranslucent">true</item>
        <item name="android:windowNoTitle">true</item>
    </style>
    
    0 讨论(0)
  • 2021-01-13 22:10

    You need to use Holo Light Dialog theme:

    <activity
        android:theme="@android:style/Theme.Holo.Light.Dialog"
        android:name="com.example.dialog"
        android:label="@string/title_activity_list" />
    
    0 讨论(0)
  • 2021-01-13 22:19

    try this may be help you

    <activity
        android:theme="@android:style/Theme_Wallpaper"
        android:name="com.example.dialog"
        android:label="@string/title_activity_list" 
        >
    </activity>
    
    0 讨论(0)
  • 2021-01-13 22:27

    Way around is to define custom theme into style xml, check below code:-

    Style:

    <style name="Theme.D1NoTitleDim" parent="android:style/Theme.Translucent">
    <item name="android:windowNoTitle">true</item>
    <item name="android:windowContentOverlay">@null</item>
    <item name="android:backgroundDimEnabled">true</item>
    <item name="android:background">#22000000</item>
    </style>
    

    manifest:

    <activity
       android:theme="@style/Theme.D1NoTitleDim"
        android:name="com.example.dialog"
        android:label="@string/title_activity_list" 
        >
    </activity>
    
    0 讨论(0)
提交回复
热议问题