flutter 疑难杂症

1. TextField没法正常显示

解决方法: 添加 Expandedandroid

        new Expanded(
                  child: new TextField(

 

2. TextField显示位置偏离 

解决方法: border: InputBorder.none, contentPadding: new EdgeInsets.all(0.0)字体

              new Expanded(
                  child: new TextField(
                    controller: NameController,
                    //keyboardType: TextInputType.text,
                    textAlign: TextAlign.center,
                    autocorrect: true,

                    style: new TextStyle(
                      fontSize: 14, //字体大小
                      color: const Color(0xff000000),
                    ),
                    decoration: new InputDecoration(
                      //contentPadding: EdgeInsets.all(10.0),
                      hintText: '请输入负责人姓名',
                      hintStyle: new TextStyle(fontSize: 14.0),
                      border: InputBorder.none,
                        contentPadding: new EdgeInsets.all(0.0)
                    ),
                    autofocus: false,
                  ),
                )
 

2. AppBar多出一部分显示

解决方案 添加 automaticallyImplyLeading: false

          child: AppBar(
            title: TabBar(
              controller: _tabController,
              tabs: myTabs,
              labelColor: Color(0xff333333),
              unselectedLabelColor: Color(0xff999999),
              indicatorColor: Color(0xff333333),
            ),
            automaticallyImplyLeading: false,//这个控制多余的空白是否显示
            backgroundColor: Color(0xffffffff),
            titleSpacing: 0,
          ),

 

4. tabBar 和tabview做为子控件不能显示

 

 

 

5.平白无故报错gradle

error: resource android:attr/dialogCornerRadius not found error: resource 

android:attr/fontVariationSettings not found error: resource 

android:attr/ttcIndex not found

根据 https://stackoverflow.com/questions/49208772/error-resource-androidattr-fontvariationsettings-not-found 中的提示ui

修改build.gradle里面的spa

 

android {
compileSdkVersion 28
从新运行,一切正常





保证不被刘海屏遮挡控件
        padding: EdgeInsets.only(top: MediaQuery.of(context).padding.top),
 

 

 

集成插件,引用本地插件.net

https://blog.csdn.net/hekaiyou/article/details/72862653插件

 

平台断定3d

      theme: defaultTargetPlatform == TargetPlatform.iOS
          ? iOSTheme
          : AndroidTheme,
相关文章
相关标签/搜索