forked from crazycodeboy/react-native-splash-screen
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d4ab6ca
commit d4e860d
Showing
64 changed files
with
8,272 additions
and
11,903 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,4 +28,6 @@ DerivedData | |
# | ||
node_modules/ | ||
npm-debug.log | ||
examples/ | ||
examples/ | ||
screenshot/ | ||
*.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
在新版Xcode 中 而LaunchImage已经退出了历史的舞台,要为iOS APP添加启动屏可以通过LaunchScreen.storyboard 或 LaunchScreen.xib两种方式,两种方式思路相同,接下来就介绍下如何通过LaunchScreen.storyboard 来为RN应用添加启动屏。 | ||
|
||
## 步骤 | ||
|
||
1. 创建LaunchScreen.storyboard | ||
2. 创建LaunchScreen Image Set | ||
3. 在LaunchScreen.storyboard中添加ImageView并绑定LaunchScreen Image | ||
4. 应用LaunchScreen.storyboard | ||
5. 删除APP,重新运行 | ||
|
||
### 创建LaunchScreen.storyboard | ||
|
||
RN创建的项目默认是不带LaunchScreen.storyboard的,所以我们需要手动创建,用xcode打开项目下的iOS项目然后在左侧文件导航面板右键选择新建文件: | ||
|
||
![new-LaunchScreen-storyboard.jpg](https://raw.githubusercontent.com/crazycodeboy/react-native-splash-screen/master/screenshot/new-LaunchScreen-storyboard.jpg) | ||
|
||
|
||
### 创建LaunchScreen Image Set | ||
|
||
打开`Images.xcassets`然后添加名为`LaunchScreen`的Image Set: | ||
|
||
![new-LaunchScreen-image-set.jpg](https://raw.githubusercontent.com/crazycodeboy/react-native-splash-screen/master/screenshot/new-LaunchScreen-image-set.jpg) | ||
|
||
### 在LaunchScreen.storyboard中添加ImageView并绑定LaunchScreen Image | ||
|
||
打开`LaunchScreen.storyboard`,然后添加一个ImageView,调整好大小与约束,在为其绑定LaunchScreen Image Set: | ||
|
||
![apply-image-set.jpg](https://raw.githubusercontent.com/crazycodeboy/react-native-splash-screen/master/screenshot/apply-image-set.jpg) | ||
|
||
### 应用LaunchScreen.storyboard | ||
|
||
然后不要忘记在TARGETS中设置`Launch Screen File`: | ||
|
||
![apply-Launchscreen.jpg](https://raw.githubusercontent.com/crazycodeboy/react-native-splash-screen/master/screenshot/apply-Launchscreen.jpg) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module.exports = { | ||
root: true, | ||
extends: '@react-native-community', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module.exports = { | ||
bracketSpacing: false, | ||
jsxBracketSameLine: true, | ||
singleQuote: true, | ||
trailingComma: 'all', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,23 +32,23 @@ export default class example extends Component { | |
<TouchableOpacity | ||
style={styles.container} | ||
onPress={(e)=> { | ||
Linking.openURL('http://www.devio.org/'); | ||
Linking.openURL('https://coding.imooc.com/class/304.html'); | ||
}} | ||
> | ||
<View > | ||
<Text style={styles.item}> | ||
SplashScreen 启动屏 | ||
</Text> | ||
<Text style={styles.item}> | ||
@:http://www.devio.org/ | ||
</Text> | ||
<Text style={styles.item}> | ||
GitHub:https://github.com/crazycodeboy | ||
</Text> | ||
<Text style={styles.item}> | ||
Email:[email protected] | ||
</Text> | ||
</View> | ||
<View > | ||
<Text style={styles.item}> | ||
SplashScreen 启动屏 | ||
</Text> | ||
<Text style={styles.item}> | ||
@:http://www.devio.org/ | ||
</Text> | ||
<Text style={styles.item}> | ||
GitHub:https://github.com/crazycodeboy | ||
</Text> | ||
<Text style={styles.item}> | ||
Email:[email protected] | ||
</Text> | ||
</View> | ||
</TouchableOpacity> | ||
) | ||
} | ||
|
@@ -69,4 +69,4 @@ const styles = StyleSheet.create({ | |
height: 0.3, | ||
backgroundColor: 'darkgray', | ||
}, | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/** | ||
* @format | ||
*/ | ||
|
||
import 'react-native'; | ||
import React from 'react'; | ||
import App from '../App'; | ||
|
||
// Note: test renderer must be required after react-native. | ||
import renderer from 'react-test-renderer'; | ||
|
||
it('renders correctly', () => { | ||
renderer.create(<App />); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.