简体   繁体   English

Expo react本机应用程序图像在testflight ios上无法正常工作

[英]Expo react native app image not work properly on testflight ios

I have an app login page centered on screen.我有一个以屏幕为中心的应用程序登录页面。 When i test on locally with expo on win server and also tested mac on a simulator it works perfectly but when i do build-ios and put it to appstore and test with testflight it is not working properly.当我在 win 服务器上使用 expo 进行本地测试并在模拟器上测试 mac 时,它运行良好,但是当我构建 ios 并将其放入 appstore 并使用 testflight 进行测试时,它无法正常工作。

This code works on android also.此代码也适用于 android。 What am i doing wrong?我究竟做错了什么?

You can check full code on github with master branch : https://github.com/saricabasak/keyholder I also share releated codes below that you can check fast您可以使用 master 分支在 github 上检查完整代码: https : //github.com/saricabasak/keyholder我也在下面分享相关代码,您可以快速检查

View that i run expo on locally:查看我在本地运行 expo:

在此处输入图片说明

on testflight:在试飞中:

在此处输入图片说明

app.json

{
  "expo": {
    "name": "key-holder",
    "slug": "key-holder",
    "privacy": "public",
    "sdkVersion": "35.0.0",
    "platforms": [
      "ios",
      "android",
      "web"
    ],
    "version": "1.1.0",
    "orientation": "portrait",
    "icon": "./assets/kilit_logo_logo_500x500.png",
    "splash": {
      "image": "./assets/kilit_logo_logo_1000x1000.png",
      "resizeMode": "contain",
      "backgroundColor": "#DAD7C5"
    },
    "updates": {
      "fallbackToCacheTimeout": 0
    },
    "assetBundlePatterns": [
      "**/*"
    ],
    "ios": {
      "supportsTablet": false,
      "bundleIdentifier": "com.coderals.keyholder",
      "buildNumber": "1.0.0"
    },
    "android": {
      "package": "com.coderals.keyholder",
      "versionCode": 1
    },
    "androidStatusBar": {
      "barStyle": "light-content",
      "backgroundColor": "#334393"
    },
    "description": ""
  }
}

image Code:图片代码:

import logo from '../../assets/transparentLogo.png';


export default class KeyHolderContainer extends Component {
  render() {
    let renderLogo;
    let renderText;
    if (this.props.isLogin) {
      renderLogo = (
        <Image
          source={logo}
          style={container.logoStyle}
          resizeMode="center"
        />
      );
      renderText = (
        <Text style={container.titleStyle}>
          {translate("KeyHolderWelcome")}
        </Text>
      );
    }

    return (
      <Container style={container.containerStyle}>
        {renderLogo}
        {renderText}
        {this.props.children}
      </Container>
    );
  }
}

styles:款式:

export const container = StyleSheet.create({
  containerStyle: {
    width: "100%",
    height: "100%",
    backgroundColor: getStyle("container.backgroundColor")
  },
  logoStyle: {
    width: "40%",
    height: "40%",
    alignSelf: "center"
  },
  titleStyle: {
    color: getStyle("container.titleColor"),
    fontSize:20,
    fontWeight: "bold",
    alignSelf: "center"
  }
});

the image size : 500 x 500 on asset folder.图像大小:资产文件夹上的 500 x 500。

after long efforts, I did changed below for ios and solved.经过长时间的努力,我确实在下面为ios进行了更改并解决了。

 <Image
          source={logo}
          style={container.logoStyle}
          resizeMode="center"
        />

to

 <Image
          source={logo}
          style={container.logoStyle}
          resizeMode="contain"
        />

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM