我有一个带有不同启动画面的应用程序。一个是意大利语,一个是英语。如何设置我的应用程序以根据系统语言选择正确的图像?
我正在 Eclipse 中为 Android 应用程序编码。我开发了一个闪屏,我需要在我的应用程序启动前显示 5 秒。怎么做?
我已经在 SO 上查找了类似的帖子。我添加了 splash.java 类, splash_layout.xml 文件,
我有 2 个应用程序图标出现在桌面模拟器上,并且有飞溅,但 2 个图标不好 我怀疑它是关于清单的,我在那里放什么作为 android.MAIN、android.DEFAULT?
这是我的 android manifest.xml 文件:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.kaban.it_ebooksinfomobile" >
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="@drawable/logo"
android:label="@string/app_name"
android:theme="@style/Theme.Book">
<something must be here for splash screen before MainActivity...>
<activity
android:name=".MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Run Code Online (Sandbox Code Playgroud)
这是飞溅的java文件:
package com.example.kaban.it_ebooksinfomobile;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
public class SplashScreen extends Activity {
private final int SPLASH_DISPLAY_LENGTH = 1000;
private static …Run Code Online (Sandbox Code Playgroud) 我试图让启动画面首先出现并在启动后MainForm出现.但是我在启动画面中的进度条没有到达栏的末尾.程序继续运行而不起作用.
如何在加载主窗体期间显示启动画面?
我的代码就是这样的:
public partial class SplashForm : Form
{
public SplashForm()
{
InitializeComponent();
}
private void SplashForm_Load(object sender, EventArgs e)
{
timer1.Enabled = true;
timer1.Start();
timer1.Interval = 1000;
progressBar1.Maximum = 10;
timer1.Tick += new EventHandler(timer1_Tick);
}
public void timer1_Tick(object sender, EventArgs e)
{
if (progressBar1.Value != 10)
{
progressBar1.Value++;
}
else
{
timer1.Stop();
Application.Exit();
}
}
}
Run Code Online (Sandbox Code Playgroud)
以下是代码的第一部分MainForm:
public partial class MainForm : Form
{
public MainForm()
{
InitializeComponent();
Application.Run(new SplashForm());
}
}
Run Code Online (Sandbox Code Playgroud) 当我的反应本机应用程序启动时,它会显示白屏几秒钟。那个白屏实际上是android提供的默认启动画面。任何人都可以建议如何从反应本机应用程序中删除默认的 Android 启动屏幕 我的 AndroidManifest.xml 看起来像:-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package=""
xmlns:tools="http://schemas.android.com/tools"
android:versionCode="1"
android:versionName="1.0">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE" tools:node="remove" />
<uses-sdk
android:minSdkVersion="16"
android:targetSdkVersion="22" />
<application
android:name=".MainApplication"
android:allowBackup="true"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher">
<!-- android:theme="@style/SplashTheme"> -->
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
</application>
Run Code Online (Sandbox Code Playgroud)
我正在使用主题从可绘制对象中制作启动画面。但是,启动屏幕的可绘制对象显示在系统栏后面,如下所示。
这是我的可绘制启动画面splash_screen.xml:
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/slighty_red" />
<item>
<bitmap
android:src="@drawable/test_icon"
android:gravity="center_horizontal|bottom" />
</item>
</layer-list>
Run Code Online (Sandbox Code Playgroud)
这是我的启动屏幕主题:
<style name="SplashTheme" parent="Theme.AppCompat.NoActionBar">
<item name="android:windowBackground">@drawable/splash_screen</item>
<item name="android:fitsSystemWindows">true</item> <!--Tried this but it doesn't work-->
</style>
Run Code Online (Sandbox Code Playgroud)
然后我将此主题应用到清单中的启动活动中:
<activity
android:name=".SplashActivity"
android:theme="@style/SplashTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Run Code Online (Sandbox Code Playgroud)
我已经尝试在启动主题中将fitsSystemWindows设置为true,并且我的启动活动没有布局文件来将fitsSystemWindows设置为true。
我怎样才能让我的启动屏幕不会显示在系统栏后面?
我想创建一个像Linkedin android app一样的启动画面.如果仔细观察,背景会以低速移动,文本内容和按钮会高速移动.
这是我的痛点。我是android开发的新手,我想为应用创建启动画面。目前,在该论坛中搜索之后,我发现了从图片中实现启动屏幕的方法,但这不是我想要的。我希望闪屏是具有变化渐变的颜色。该问题所附的图片说明了我的意思。不幸的是,由于我的信誉不佳,无法粘贴图像。尽管如此,这是渐变图像的链接。进一步说明,我希望颜色是由Java或xml代码动态生成的,因此,我不必为不同的屏幕尺寸而烦恼,我要做的就是生成所有内容以全屏显示。我要尽量避免使用图片资产。帮助Plz。