简体   繁体   English

SwiftUI 中的后缘和前缘是什么意思?

[英]What do trailing and leading edges mean in SwiftUI?

I can't find a source that says what the definition of trailing and leading edges mean in SwiftUI我在 SwiftUI 中找不到说明后缘和前缘定义含义的来源

The same as they mean in UIKit .与它们在UIKit中的意思相同。 They are a locale-dependent way of specifying horizontal edges.它们是指定水平边缘的依赖于语言环境的方式。 In a left-to-right locale, such as English, the leading edge is the left and the trailing edge is the right.在从左到右的语言环境中,例如英语,前缘是左边,后缘是右边。 In a right-to-left locale (eg Hebrew), the leading edge is on the right and the trailing edge is on the left.在从右到左的语言环境中(例如希伯来语),前缘在右边,后缘在左边。

By specifying spacing in terms of leading/trailing rather than left/right you can ensure that your layout is consistent regardless of the user's locale.通过根据前导/尾随而不是左/右指定间距,您可以确保无论用户的区域设置如何,您的布局都是一致的。

Trailing edge - like it's right side of view.后缘 - 就像它是视图的右侧。 When you want to view should have left padding 20 from left side of view controller its means you should set padding for leading edge.当你想从视图 controller 的左侧查看应该有 left padding 20 时,这意味着你应该为前沿设置填充。 this is for right side same.这是右侧相同。 It's just sides of view.这只是观点的两面。

There great examples for clearly understand link .有很好的例子可以清楚地理解链接

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

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