简体   繁体   中英

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

The same as they mean in 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. this is for right side same. It's just sides of view.

There great examples for clearly understand link .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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