-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
4 changed files
with
46 additions
and
5 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 |
---|---|---|
@@ -1,6 +1,9 @@ | ||
## render方法中不能使用双斜杠注释html的内容 | ||
## render方法中的jsx不能使用双斜杠注释html的内容 | ||
|
||
## 控件的边框 | ||
有的控件在ios中可以使用border设置边框,但在Android中却没有边框效果,比如Text控件 | ||
|
||
## rn开启js调试后,导航栏跳转不起作用 | ||
## rn开启js调试后,导航栏跳转不起作用 | ||
|
||
## return返回jsx时,必须return和括号必须靠紧,如: `return(....` | ||
|
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 |
---|---|---|
@@ -1,7 +1,23 @@ | ||
|
||
|
||
````js | ||
import {Dimensions} from 'react-native'; | ||
var React = require('Dimensions'); | ||
|
||
console.log(Dimensions.get("window")); | ||
//结果:{width: 375, scale: 2, height: 667} | ||
```` | ||
```` | ||
|
||
|
||
在css中使用 | ||
|
||
```` | ||
const styles = StyleSheet.create({ | ||
textView: { | ||
...... | ||
width:Dimensions.get('window').width, | ||
}, | ||
{ | ||
} | ||
}); | ||
````` |
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,21 @@ | ||
## 键盘回退 | ||
|
||
````javascript | ||
|
||
<TextInput style={styles.textInput} | ||
ref='pwd' | ||
placeholder='输入WIFI密码' | ||
placeholderTextColor='#999' | ||
secureTextEntry={this.state.secureTextEntry} | ||
> | ||
</TextInput> | ||
|
||
<TouchableOpacity | ||
style={styles.show_pwd_warp} | ||
onPress={() => this.refs.pwd.blur()} | ||
> | ||
</TouchableOpacity> | ||
|
||
```` | ||
|
||
说明:第一个textInput使用了ref定义了名称为pwd,通过touTouchableOpacity点击调用了this.refs.pwd.blur()方法,让文本框失去焦点,从而回退键盘 |