problem description
the pictures in the project are divided into pictures of axi2x.pngjinaxiaqing3x.
so it is directly introduced in this way when it is introduced
<Image
// source={require("../../../images/ios/a.png")}
source={require(LoginImages.logo)}
style={{
width: px2dp(101),
height: px2dp(94)
}}
/>
this introduction is fine, but I created a new .js
file under images to export all the pictures
const LoginImages = {
logo: require("./ios/LOGO.png"),
// login: require("./ios/login@2x.png"),
// userIcon: require("./ios/usericon@2x.png"),
// pwdIcon: require("./ios/pwdIcon@2x.png"),
// mobile: require("./ios/mobile@2x.png"),
// back: require("./ios/back@2x.png"),
// register: require("./ios/register@2x.png")
};
export { LoginImages };
then use
directly where needed. <Image
// source={require("../../../images/ios/LOGO.png")}
source={require(LoginImages.logo)}
style={{
width: px2dp(101),
height: px2dp(94)
}}
/>
such a method is introduced, but react-native prompts that the content of the picture is empty. What is the situation
hope to solve the problem