【发布时间】:2020-12-19 01:02:31
【问题描述】:
在 Android 中,页面加载时键盘展开,焦点位于搜索栏上。
我试图让焦点不在页面加载时出现。相关代码为:
<StackLayout height="100%"
class="main-container"
>
<SearchBar ref="searchBars"
class="search-bar"
@loaded="onSearchLoaded($event)"
@textChange="onTextChanged($event)"/>
我已尝试添加:
mounted() {
this.$refs.searchBars.nativeView.dismissSoftInput();
}
但这没有奏效。我还尝试添加this.$refs.searchBars.nativeView.dismissSoftInput()
到searchBar的@loaded事件函数。
【问题讨论】:
标签: nativescript nativescript-vue