本文介绍了Xcode 7 什么是视图“语义"?故事板设置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看到 iOS9 和 xCode7 在故事板配置中引入了一个名为语义"的新字段.谷歌搜索未在顶部显示相关结果.

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.

视图语义域的意义是什么?

推荐答案

iOS 9 中有一个新的国际化支持,可以根据当前系统语言从左到右翻转界面,反之亦然.您可以选择阿拉伯语进行测试.阿拉伯语是从右到左阅读的,所以界面是翻转的.

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.

storyboard 中的Semantic"属性是一个规则,它允许 iOS 知道是否应该翻转视图.有多种选择:

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.

来源 - Apple 的文档

这篇关于Xcode 7 什么是视图“语义"?故事板设置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-17 03:33
查看更多