Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
582 views
in Technique[技术] by (71.8m points)

uiview - Xcode 7 what is the view "semantic" storyboard setting?

I see that iOS9 and xCode7 introduced a new field called "semantic" into storyboard config. A google search did not reveal relevant results on top.

What is the significance of the view semantic field? enter image description here

question from:https://stackoverflow.com/questions/32634774/xcode-7-what-is-the-view-semantic-storyboard-setting

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

There is a new internationalization support in iOS 9, which enables flipping of the interface from left to right and vice versa depending on the current system language. You can choose Arabic language to test it. Arabic is read from right to left, so the interface is flipped.

Here you can read the Apple's guide on it.

The property "Semantic" in the storyboard is a rule which allows the iOS to know if the view should be flipped or not. There are multiple options:

  • Unspecified - The default value for views. The view is flipped when switching between left-to-right and right-to-left layouts.
  • Playback - A view representing the playback controls, such as Play, Rewind, or Fast Forward buttons or playhead scrubbers. These views are not flipped when switching between left-to-right and right-to-left layouts.
  • Spatial - A view representing a directional control, for example a segment control for text alignment, or a D-pad control for a game. These views are not flipped when switching between left-to-right and right-to-left layouts.
  • Force Left-To-Right - A view that is always displayed using a left-to-right layout.
  • Force Right-To-Left - A view that is always displayed using a right-to-left layout.

Source - Apple's documentation


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...