![](/img/trans.png)
[英]Tab bar indicator color is not updating on swipe of tabbarview in flutter?
[英]Disble keyboard on tab bar swipe flutter
我的 flutter 應用程序中有一個標簽欄。 標簽欄視圖有兩個屏幕,有兩個不同的 forms。我如何在第一個標簽屏幕上編輯表單,當我切換到第二個標簽屏幕時,上一個屏幕上的文本字段被選中。 如何在標簽屏幕上滑動時禁用鍵盤。
tabController = TabController(length: 2, vsync: this);
tabController?.addListener(() {
if(tabController!.indexIsChanging){
FocusScope.of(Get.context!).unfocus();
}
});
我試過上面的代碼。 但我不能在滑動時處理鍵盤
請嘗試以下代碼。 我希望它能解決你的問題。
SystemChannels.textInput.invokeMethod('TextInput.hide');
你做錯了,試試這個簡單的方法來隱藏軟鍵盤。你應該把整個屏幕包裹在GestureDetector方法和onTap方法中,編寫這段代碼。
FocusScope.of(context).requestFocus(new FocusNode());
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.