react-native-admob icon indicating copy to clipboard operation
react-native-admob copied to clipboard

How to put center?

Open shinriyo opened this issue 5 years ago • 4 comments

I put code.

      <AdMobBanner
        adSize="fullBanner"
        adUnitID="ca-app-pub-00000/0000000"
      />

but, it is not center.

So, I wrote parent View tag.

      <View style={styles.banner}>
        <AdMobBanner
          adSize="fullBanner"
          adUnitID="ca-app-pub-00000/0000000"
        />
      </View>

and style sheet.

const styles = StyleSheet.create({
  banner: {
    justifyContent: 'center',
  }
});

never changed. notcenter

shinriyo avatar Sep 18 '18 08:09 shinriyo

With me this problem also happens. Has anyone found a solution?

antonioolf avatar Nov 20 '18 21:11 antonioolf

With me this problem also happens. Has anyone found a solution?

use alignItems too, try this styles: banner: { justifyContent: "center", alignItems: "center" }

P-u-r-i-a avatar Nov 21 '18 09:11 P-u-r-i-a

I added style for parentview. It's working style={{width:'100%', position:'absolute', justifyContent: "center", alignItems: "center"}}

doandat avatar Dec 18 '18 14:12 doandat

Hello , Im also having the same problem . I also tried the solutions above , not working for me . How did it work for you guys ?

"react-native-google-mobile-ads": "^7.0.1", "react-native": "0.66.3",

lloydllim avatar Jul 27 '22 10:07 lloydllim