Fragster
@Fragster
помогло? отметь решением!

Как убрать непонятные элементы сплеш скрина на в приложении с webview?

Заворачиваю веб приложение в веб вью, использую капаситор.
Есть задача сделать сплеш скрин. Подключил соответствующий плагин https://github.com/ionic-team/capacitor-plugins/bl...
На большинстве устройств все +- нормально, но на двух есть артефакты:
Что-то похожее на волос:
T31yfrz.png

Вообще непонятное что-то:
Olf2mZR.png

при этом никаких особых манипуляций не делал. Сделал только чтобы картинка не растягивалась,а масштабировалась:

capacitor.config.json

{
  "appId": "ru.cidk.app",
  "appName": "ЦИДК",
  "webDir": "www",
  "plugins": {
    "Keyboard": {
      "resize": "body",
      "style": "DEFAULT",
      "resizeOnFullScreen": true
    },
    "SplashScreen": {
      "launchShowDuration": 500,
      "launchAutoHide": false,
      "backgroundColor": "#96b4bc",
      "splashFullScreen": true,
      "androidScaleType": "CENTER_CROP",
      "androidSplashResourceName": "splash_res",
      "layoutName": "launch_screen"
    },
    "SafeArea": {
      "enabled": true,
      "customColorsForSystemBars": true,
      "statusBarColor": "#00000000",
      "navigationBarColor": "#00000000",
      "navigationBarContent": "dark",
      "offset": 0
    },
    "CapacitorHttp": {
      "enabled": true
    }
  }
}


styles.xml

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

    <!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
        <!-- Customize your theme here. -->
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorAccent</item>
    </style>

    <style name="AppTheme.NoActionBar" parent="Theme.AppCompat.DayNight.NoActionBar">
        <item name="windowActionBar">false</item>
        <item name="windowNoTitle">true</item>
        <item name="android:background">@null</item>
    </style>


    <style name="AppTheme.NoActionBarLaunch" parent="Theme.SplashScreen">
      <item name="android:background">@drawable/splash_res</item>
      <item name="background">@drawable/splash_res</item>

      <item name="android:colorBackground">@color/ic_launcher_background</item>
      <item name="android:navigationBarColor">@android:color/transparent</item>
      <item name="android:statusBarColor">@android:color/transparent</item>
    </style>
</resources>


splash_res.xml

@drawable/splash - это png файл с заставкой
<?xml version="1.0" encoding="utf-8"?>
<bitmap
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:src="@drawable/splash"
  android:gravity="clip_vertical"
  />


activity_main.xml Его вообще не менял

<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">

    <WebView
        android:layout_width="match_parent"
        android:layout_height="match_parent" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>


AndroidManifest.xml его тоже не менял

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

    <application
        android:usesCleartextTraffic="true"
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">

        <activity
            android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode"
            android:name=".MainActivity"
            android:label="@string/title_activity_main"
            android:theme="@style/AppTheme.NoActionBarLaunch"
            android:launchMode="singleTask"
            android:exported="true">

            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>

        </activity>

        <provider
            android:name="androidx.core.content.FileProvider"
            android:authorities="${applicationId}.fileprovider"
            android:exported="false"
            android:grantUriPermissions="true">
            <meta-data
                android:name="android.support.FILE_PROVIDER_PATHS"
                android:resource="@xml/file_paths"></meta-data>
        </provider>
    </application>

    <!-- Permissions -->

    <uses-permission android:name="android.permission.INTERNET" />
</manifest>


MainActivity.java не трогал

package ru.cidk.app;

import com.getcapacitor.BridgeActivity;

public class MainActivity extends BridgeActivity {}

Вообще не представляю, откуда это взялось. Прошу помощи, как найти и как убрать?

После сплешскрина приложение выглядит и работает нормально
  • Вопрос задан
  • 34 просмотра
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы