优化写日记页键盘弹出效果

This commit is contained in:
mx1700 2019-08-05 22:29:03 +08:00
parent 0ef9303bbd
commit 177d5e54d6

View file

@ -114,10 +114,9 @@ export default class WritePage extends Component {
componentDidMount() { componentDidMount() {
this.loadNotebook().then(notebookCount => { this.loadNotebook().then(notebookCount => {
if(notebookCount > 0) { if(notebookCount > 0) {
setTimeout(() => { InteractionManager.runAfterInteractions(() => {
this.contentInput.focus(); this.contentInput.focus();
}, 500); });
} else { } else {
Alert.alert('提示', '没有可用日记本,无法写日记',[ Alert.alert('提示', '没有可用日记本,无法写日记',[
{text: '取消', onPress: () => {}}, {text: '取消', onPress: () => {}},