这两天刚开始接触ios,看的两套教程里面用的都是storyboard拖拽控件进行的布局。我之前是学前端的,布局基本上都是码代码的。所以现在我想问下,ios里布局是用storyboard比较多还是有其他方式(比如像css一样码代码的)?其他方式还有哪些呢?有什么好的ios的UI教程可以推荐一下?谢谢啦~
迷茫2017-04-17 15:30:41
This is a technical blog written by an expert. You can refer to it.
Link description
In addition to storyboard, you can also use xib in a mixed manner, using xib only on individual simple pages. Complex pages can be written in code.
If you don't use xib or storyboard, you can only use pure code. The main reason is that Apple has more screens now, and xib is easier to adapt to.
But it doesn't matter. If you use code, it doesn't matter if you use relative layout. The relative layout of the system is too unfriendly. It is recommended to use masonry. A third party that specifically encapsulates the relative layout of the system is very convenient to use.
As for UI tutorials, if you search online, there should be a lot of text and video tutorials, and there are so many training institutions now. There will be no shortage of tutorials.
怪我咯2017-04-17 15:30:41
It depends on the needs. Handwritten code should be commented, the code hierarchy should be standardized, and it is easy to maintain
高洛峰2017-04-17 15:30:41
I used to use xib+code, now I use pure code, sb means I have never used it and I don’t know how to use it. Pure code will be slower at the beginning, but it will be easier to maintain in the future, and it will be a good exercise to improve your ability to reuse code.
阿神2017-04-17 15:30:41
Personally, I think mixing sb and code will improve the efficiency of development. After all, this kind of issue is a matter of opinion.
怪我咯2017-04-17 15:30:41
I used to write in code, but after I came into contact with sb and xib, I found the layout very convenient. Drag the control up and you can intuitively see the interface to be developed. It is easy to modify and add constraints. Now is the code, sb, xib are used together.
PHP中文网2017-04-17 15:30:41
Storyboard is the mainstream. On the one hand, the layout is convenient and the hierarchical structure is clear; on the other hand, it facilitates the subsequent development of the project
巴扎黑2017-04-17 15:30:41
Only the startup image uses xib, all projects use the interface written in code