Suggestions for centering the resulting container?
adcooley opened this issue · comments
It appears that after the container is rendered, the container width > the width of all the items. I tried calculating the # of columns that would be rendered myself and adding padding to adjust, but it's not quite right.
Anyone have a suggestion for this?
I agree. Its an important feature to have. For example: I have grid cells of width 200 and screen width is 500. If I set cellMargin as 20 and margin on individual cells as 20 then I am still left with 60 pixels on the right compared to 20 pixels on the left.
Can you give some pointers on how this can be solved?
Any elegant solution to this yet?
可以给 AutoResponsive 的父元素 div 设置样式,例如
width: 650,
margin-left: auto,
margin-right: auto,
如果是2列,React native 也可以这样设置
itemMargin={(screenWidth - 160 * 2) / 3}
子元素样式
width: 160,
transform: [{translateX: (screenWidth - 160 * 2) / 3}],