Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion cndocs/_integration-with-existing-apps-ios.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ AppRegistry.registerComponent('HelloWorld', () => App);
让我们创建一个 `App.tsx` 文件。这是一个 [TypeScript](https://www.typescriptlang.org/) 文件,可以包含 [JSX](<https://en.wikipedia.org/wiki/JSX_(JavaScript)>) 表达式。它包含我们要集成到 iOS 应用程序中的根 React Native 组件(<RNTemplateRepoLink href="template/App.tsx">链接</RNTemplateRepoLink>):

```tsx
import React from 'react';
import {
SafeAreaView,
ScrollView,
Expand Down
3 changes: 1 addition & 2 deletions cndocs/_integration-with-existing-apps-kotlin.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ dependencies {
}

+react {
+ // 启用自动链接需要添加以下行,参考: https://github.com/react-native-community/cli/blob/master/docs/autolinking.md
+ // 启用自动链接需要添加以下行,参考: https://github.com/react-native-community/cli/blob/main/docs/autolinking.md
+ autolinkLibrariesWithApp()
+}
```
Expand Down Expand Up @@ -193,7 +193,6 @@ AppRegistry.registerComponent('HelloWorld', () => App);
下面我们创建一个 `App.tsx` 文件。这是一个 [TypeScript](https://www.typescriptlang.org/) 文件,可以包含 [JSX](<https://en.wikipedia.org/wiki/JSX_(JavaScript)>) 表达式。它包含了我们将在 Android 应用中集成的根 React Native 组件(<RNTemplateRepoLink href="template/App.tsx">链接</RNTemplateRepoLink>):

```tsx
import React from 'react';
import {
SafeAreaView,
ScrollView,
Expand Down
42 changes: 21 additions & 21 deletions cndocs/accessibilityinfo.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ title: AccessibilityInfo
## 示例

```SnackPlayer name=AccessibilityInfo%20Example&supportedPlatforms=android,ios
import React, {useState, useEffect} from 'react';
import {useState, useEffect} from 'react';
import {AccessibilityInfo, Text, StyleSheet} from 'react-native';
import {SafeAreaView, SafeAreaProvider} from 'react-native-safe-area-context';

Expand Down Expand Up @@ -90,16 +90,16 @@ static addEventListener(

添加事件处理函数。支持的事件如下:

| 事件名 | 说明 |
| -------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `accessibilityServiceChanged`<br/><div className="label two-lines android">Android</div> | 当 TalkBack、其他 Android 辅助技术或第三方无障碍服务被启用时触发。处理函数参数为布尔值:当任一无障碍服务启用时为 `true`,否则为 `false`。 |
| `announcementFinished`<br/><div className="label two-lines ios">iOS</div> | 当读屏器完成播报时触发。处理函数参数是一个对象,包含:<ul><li>`announcement`:读屏器播报的文本。</li><li>`success`:是否成功播报的布尔值。</li></ul> |
| `boldTextChanged`<br/><div className="label two-lines ios">iOS</div> | 当“粗体文本”开关状态变化时触发。参数为布尔值:启用为 `true`,否则为 `false`。 |
| `grayscaleChanged`<br/><div className="label two-lines ios">iOS</div> | 当“灰度”开关状态变化时触发。参数为布尔值:启用为 `true`,否则为 `false`。 |
| `invertColorsChanged`<br/><div className="label two-lines ios">iOS</div> | 当“反转颜色”开关状态变化时触发。参数为布尔值:启用为 `true`,否则为 `false`。 |
| `reduceMotionChanged` | 当“减少动态效果”开关状态变化时触发。参数为布尔值:启用为 `true`,否则为 `false`。(在 Android 上,“开发者选项”中的“过渡动画比例”设为“动画关闭”也会返回 `true`。) |
| `reduceTransparencyChanged`<br/><div className="label two-lines ios">iOS</div> | 当“降低透明度”开关状态变化时触发。参数为布尔值:启用为 `true`,否则为 `false`。 |
| `screenReaderChanged` | 当读屏器状态变化时触发。参数为布尔值:启用为 `true`,否则为 `false`。 |
| 事件名 | 说明 |
| ---------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `accessibilityServiceChanged`<br/><div className="label two-lines android">Android</div> | 当 TalkBack、其他 Android 辅助技术或第三方无障碍服务被启用时触发。处理函数参数为布尔值:当任一无障碍服务启用时为 `true`,否则为 `false`。 |
| `announcementFinished`<br/><div className="label two-lines ios">iOS</div> | 当读屏器完成播报时触发。处理函数参数是一个对象,包含:<ul><li>`announcement`:读屏器播报的文本。</li><li>`success`:是否成功播报的布尔值。</li></ul> |
| `boldTextChanged`<br/><div className="label two-lines ios">iOS</div> | 当“粗体文本”开关状态变化时触发。参数为布尔值:启用为 `true`,否则为 `false`。 |
| `grayscaleChanged`<br/><div className="label two-lines ios">iOS</div> | 当“灰度”开关状态变化时触发。参数为布尔值:启用为 `true`,否则为 `false`。 |
| `invertColorsChanged`<br/><div className="label two-lines ios">iOS</div> | 当“反转颜色”开关状态变化时触发。参数为布尔值:启用为 `true`,否则为 `false`。 |
| `reduceMotionChanged` | 当“减少动态效果”开关状态变化时触发。参数为布尔值:启用为 `true`,否则为 `false`。(在 Android 上,“开发者选项”中的“过渡动画比例”设为“动画关闭”也会返回 `true`。) |
| `reduceTransparencyChanged`<br/><div className="label two-lines ios">iOS</div> | 当“降低透明度”开关状态变化时触发。参数为布尔值:启用为 `true`,否则为 `false`。 |
| `screenReaderChanged` | 当读屏器状态变化时触发。参数为布尔值:启用为 `true`,否则为 `false`。 |

---

Expand All @@ -126,10 +126,10 @@ static announceForAccessibilityWithOptions(

**参数:**

| 名称 | 类型 | 说明 |
| ----------------------------------------------------------------- | ------ | ------------------------------------------------------------------------------------- |
| announcement <div className="label basic required">Required</div> | string | 要播报的字符串 |
| options <div className="label basic required">Required</div> | object | `queue` - 是否排队到当前播报之后 <div className="label ios">iOS</div> |
| 名称 | 类型 | 说明 |
| ----------------------------------------------------------------- | ------ | --------------------------------------------------------------------- |
| announcement <div className="label basic required">Required</div> | string | 要播报的字符串 |
| options <div className="label basic required">Required</div> | object | `queue` - 是否排队到当前播报之后 <div className="label ios">iOS</div> |

---

Expand All @@ -144,9 +144,9 @@ static getRecommendedTimeoutMillis(originalTimeout: number): Promise<number>;

**参数:**

| 名称 | 类型 | 说明 |
| -------------------------------------------------------------------- | ------ | ---------------------------------------------------------------------------------------- |
| originalTimeout <div className="label basic required">Required</div> | number | 当“辅助功能超时”未设置时返回的超时值(毫秒)。 |
| 名称 | 类型 | 说明 |
| -------------------------------------------------------------------- | ------ | ---------------------------------------------- |
| originalTimeout <div className="label basic required">Required</div> | number | 当“辅助功能超时”未设置时返回的超时值(毫秒)。 |

---

Expand Down Expand Up @@ -287,7 +287,7 @@ static sendAccessibilityEvent(host: HostInstance, eventType: AccessibilityEventT
确保希望接收无障碍焦点的 `View` 设置了 `accessible={true}`。
:::

| 名称 | 类型 | 说明 |
| -------------------------------------------------------------- | ----------------------- | -------------------------------------------------------------------- |
| host <div className="label basic required">Required</div> | HostInstance | 要向其发送事件的组件 ref。 |
| 名称 | 类型 | 说明 |
| -------------------------------------------------------------- | ----------------------- | -------------------------------------------------------------------------------------------------------------- |
| host <div className="label basic required">Required</div> | HostInstance | 要向其发送事件的组件 ref。 |
| eventType <div className="label basic required">Required</div> | AccessibilityEventTypes | `'click'`(仅 Android)、`'focus'`、`'viewHoverEnter'`(仅 Android)或 `'windowStateChange'`(仅 Android)之一 |
2 changes: 1 addition & 1 deletion cndocs/actionsheetios.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ title: ActionSheetIOS
## 示例

```SnackPlayer name=ActionSheetIOS%20Example&supportedPlatforms=ios
import React, {useState} from 'react';
import {useState} from 'react';
import {ActionSheetIOS, Button, StyleSheet, Text} from 'react-native';
import {SafeAreaView, SafeAreaProvider} from 'react-native-safe-area-context';

Expand Down
5 changes: 2 additions & 3 deletions cndocs/activityindicator.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ title: ActivityIndicator
## 示例

```SnackPlayer name=ActivityIndicator%20Example
import React from 'react';
import {ActivityIndicator, StyleSheet} from 'react-native';
import {SafeAreaView, SafeAreaProvider} from 'react-native-safe-area-context';

Expand Down Expand Up @@ -62,8 +61,8 @@ export default App;

滚轮的前景颜色。

| 类型 | 默认值 |
| --------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 类型 | 默认值 |
| --------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [color](colors) | `null`(系统默认强调色)<div className="label android">Android</div><hr/><ins style={{background: '#999'}} className="color-box" />`'#999999'` <div className="label ios">iOS</div> |

---
Expand Down
Loading