hi! rn .49.3 splashScreen 3.0.6 cannot run for android. Look at it. thanks
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="primary_dark">#27409d</color>
</resources>
保存为colors.xml
no, i needn't color.
code:
`import android.os.Bundle;
import com.facebook.react.ReactActivity;
import org.devio.rn.splashscreen.SplashScreen;
public class MainActivity extends ReactActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
SplashScreen.show(this, true); // here
super.onCreate(savedInstanceState);
}
/**
* Returns the name of the main component registered from JavaScript.
* This is used to schedule rendering of the component.
*/
@Override
protected String getMainComponentName() {
return "yuecai";
}
}`
but i don't open app.
闪退还是什么。我是建了个color.xml解决的闪退问题
@StarOfLife 我并不想建color.xml因为在screen加载后会有你建的color.xml页面才进入登录页面 很丑
@StarOfLife 为什么我不需要color.xml这个 还要建它 在rn .44就不需要建这个文件 极丑
react-native-splash-screen/android/src/main/res/values/refs.xml里面用到了
<item type="color" name="primary_dark">
@color/primary_dark
</item>
,但是作者没有提供color.xml这个文件。只能自己手动创建一个。
哦 原来如此
problem solved by adding colors.xml and refs.xml, thanks StarOfLife.
Most helpful comment
保存为colors.xml