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,
相關文章
相關標籤/搜索