Sfoglia il codice sorgente

width不生效

tags/jenkins-front-end-screenad-216-v119^0
caserKing 5 anni fa
parent
commit
aabe4456d8
1 ha cambiato i file con 6 aggiunte e 4 eliminazioni
  1. +6
    -4
      App.js

+ 6
- 4
App.js Vedi File

@@ -627,6 +627,8 @@ getAdView(){
</ImageBackground> </ImageBackground>
); );
} else if (this.state.adType == 2) { } else if (this.state.adType == 2) {
let curWidthNum = 394*PixelRatio.get();

return ( return (
// <ImageBackground style={styles.adTypeBg} source={require('./image/ad1.jpg')}> // <ImageBackground style={styles.adTypeBg} source={require('./image/ad1.jpg')}>
<ImageBackground style={styles.adTypeBg} resizeMode="stretch" source={{ uri: this.state.curCoverImgUrl}}> <ImageBackground style={styles.adTypeBg} resizeMode="stretch" source={{ uri: this.state.curCoverImgUrl}}>
@@ -640,8 +642,8 @@ getAdView(){
ref={'carousel'} ref={'carousel'}
data={adDataList} data={adDataList}
renderItem={this.setSwiperItemDom} renderItem={this.setSwiperItemDom}
sliderWidth={394*PixelRatio.get()}
itemWidth={394*PixelRatio.get()}
sliderWidth={curWidthNum}
itemWidth={curWidthNum}
itemHeight={134} itemHeight={134}
sliderHeight={134} sliderHeight={134}
activeSlideOffset={0} activeSlideOffset={0}
@@ -1175,8 +1177,8 @@ MyPage = CodePush(codePushOptions)(MyPage);


contentItemTopForAd:{ contentItemTopForAd:{
flex: 1, flex: 1,
width: 1127/PixelRatio.get(),
// width: '100%',
// width: 1127/PixelRatio.get(),
width: '100%',
height:'100%', height:'100%',
paddingLeft: 22/PixelRatio.get(), paddingLeft: 22/PixelRatio.get(),
paddingRight: 26/PixelRatio.get(), paddingRight: 26/PixelRatio.get(),


Caricamento…
Annulla
Salva