android开发标签栏应该设置多少钱,android – Flutter:刷卡后默认标签栏控制器......
我正在寫一個有顫動的應(yīng)用程序,有4個標簽視圖,有點像股票Android手機應(yīng)用程序或時鐘應(yīng)用程序.其中一個視圖散列浮動操作按鈕,按下該按鈕將在列表中添加一些文本.但是,當我滾動到其他視圖之一并返回時,所有文本都消失了.有沒有辦法解決這個問題?
這是我的代碼:
import 'package:flutter/material.dart';
import 'Screens/Dashboard.dart';
import 'Screens/CreateQuestionnaire.dart';
import 'Screens/AccountScreen.dart';
void main() => runApp(new MyApp());
class MyApp extends StatefulWidget {
@override
createState() => new MyAppState();
}
class MyAppState extends State {
final primaryColour = const Color(0xFF5CA1CA);
final secondaryColour = const Color(0xFFC36B42);
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return new MaterialApp(
home: new DefaultTabController(
length: 4,
child: new Scaffold(
appBar: new AppBar(
actions: [
new IconButton(icon: new Icon(Icons.account_circle),
onPressed: (){
Navigator.push(context, new MaterialPageRoute(builder: (context) => new AccountScreen()));
}),
],
bottom: new TabBar(
tabs: [
new Tab(icon: new Icon(Icons.home)),
new Tab(icon: new Icon(Icons.contacts)),
new Tab(icon: new Icon(Icons.description)),
new Tab(icon: new Icon(Icons.settings))
],
),
title: new Text("NLPro Questionnaire"),
),
body: new TabBarView(
children: [
new Dashboard(),
new CreateQuestionnaire(),
new Text("Surveys"),
new Text("Settings")
],
),
),
),
theme:new ThemeData(
primaryColor: primaryColour,
accentColor: secondaryColour,
),
);
}
}
總結(jié)
以上是生活随笔為你收集整理的android开发标签栏应该设置多少钱,android – Flutter:刷卡后默认标签栏控制器......的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: c语言程序中unit怎么定义,c ++中
- 下一篇: android tomtom gps l