带有Web视图的Android启动屏幕
我读了一篇文章,从中创建了一个闪屏 我已经为我的WebView创建了androidmanifest.xml带有Web视图的Android启动屏幕,android,android-studio,webview,splash-screen,Android,Android Studio,Webview,Splash Screen,我读了一篇文章,从中创建了一个闪屏 我已经为我的WebView创建了androidmanifest.xml <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.mobileapps.mysite"> <uses-permission android:name=
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mobileapps.mysite">
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:usesCleartextTraffic="true"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name="com.mobileapps.mysite.MainActivity"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
现在我要如何将下面的代码添加到上面的代码中
<activity android:name=".activities.MainActivity"
android:theme="@style/SplashTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
styles.xml的代码是
<resources>
<style name="SplashTheme" parent="AppTheme">
<item name="android:windowBackground">@drawable/splash</item>
</style>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
</resources>
@可牵引/飞溅
@颜色/原色
@颜色/原色暗
@颜色/颜色重音
清单中的完整代码应如下所示
问题出在哪里?似乎您的我遇到了一个错误,因为找不到C:\Users\myname\AndroidStudioProjects\mysite\New\app\src\main\AndroidManifest.xml:16:9-21:20:AAPT:error:resource style/splashteme(又名com.mobileapps.mysite:style/splashteme)。我已经用styles.xml.my bad更新了我的问题android:theme=“@style/SplashTheme”>
应该是android:theme=“@styles/SplashTheme”>
试试现在我得到的错误是-C:\Users\myname\AndroidStudioProjects\mysite\New\app\src\main\AndroidManifest.xml:16:9-21:20:AAPT:error:“@styles/SplashTheme”与属性主题(attr)不兼容参考。抱歉@style
应该是@style
。但我不知道那是什么错误