iOS: autolayout for multiple button

纵然是瞬间 提交于 2019-12-18 07:21:22

问题


In my app I have a view for 4 inch screens in this way:

And then I want to reduce the size of my buttons when the app is running on an iPhone with a 3.5 inch screen, so I set my layout in this way:

but finally I obtain a view in this way

In this way the size of my button are ok but they are not aligned, so in this situation, what's the way to have aligned buttons?

thanks


回答1:


Hi as per your question i've created demo similar to the layout for which you need the controls need to set. I've added images for single control and made video this using multiple controls to set the layout which you retrying to set.



link: https://www.youtube.com/watch?v=Nl2iMF0yKW8&list=PLXCowKcXAVgrxHKLWTa4HxNPrSmTj3D-_
Hope this will solve your issue.




回答2:


I may not comment till I 50 posts, so here is the link. I had like the same problem some days ago. Just put all those in a parent view and center the parent view.

Link to my question/answer: Top constraint won't get less with auto-layout



来源:https://stackoverflow.com/questions/24907080/ios-autolayout-for-multiple-button

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!