Android Studio Layout Preview Default Theme

后端 未结 2 447
误落风尘
误落风尘 2021-02-07 21:54

Maybe this is well known option in Android Studio but I couldn\'t find it and Google has not helped me with this :( Every time I open a layout preview in Android Studio it\'s ap

相关标签:
2条回答
  • 2021-02-07 22:51

    Click here and change theme to your theme.

    If you want a single theme to always open, give

    android:theme="@style/YourTheme" in your <application> tag in Manifest file.

    From next time onwards, when you create a new xml file, this will be your default theme.

    0 讨论(0)
  • 2021-02-07 22:53

    You need to provide default theme on application tag in AndroidManifest.xml file. If you don't provide android:theme="@style/{themeName} there will be added Material.Light default theme.

    Please check example of code snippet from my manifest file

    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="com.mypackage.iqall" >
    
        <uses-permission android:name="android.permission.INTERNET" />
    
    
        <application
            android:allowBackup="true"
            android:icon="@drawable/iqall_main"
            android:label="@string/app_name"
            android:logo="@drawable/logo"
            android:theme="@style/AppTheme" <!--in Preview you will see this as default preview-->
            android:name=".IQallApp">
      </application>
    
    </manifest>
    
    0 讨论(0)
提交回复
热议问题