简体   繁体   English

如何在纵向和横向模式下在本机反应中以固定宽度居中

[英]How to center a parent with fixed width in react native in portrait and landscape mode

  • I am trying to center a parent with fixed width (no padding)containing children element in portrait and landscape mode我试图在纵向和横向模式下将包含子元素的固定宽度(无填充)的父元素居中
  • Attaching the expo link for reference :- [Demo] https://snack.expo.io/H1a6!91kU附上世博链接供参考:- [Demo] https://snack.expo.io/H1a6!91kU

If I understand your question, you want to center horizontally the wrapper view.如果我理解您的问题,您希望将wrapper视图水平居中。 For this, add alignItems: 'center' to your container style为此,将alignItems: 'center'添加到您的container样式

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

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