修复Flutter输入框光标文字焦点不对齐问题

原标题:修复Flutter输入框(TextField等)光标与文字焦点不对齐问题

最近Flutter频繁更新,更新到1.9的时候发现光标焦点文字不对齐了,

看了一下源码才发现改动点。

解决方案:

直接在style属性加个文字样式,值为:TextStyle(textBaseline: TextBaseline.alphabetic),

掩饰代码:

new TextField(
   style: TextStyle(textBaseline: TextBaseline.alphabetic),
),

效果:

点击查看原图

本博客所有文章如无特别注明均为原创。作者:flutter教程网复制或转载请以超链接形式注明转自 Flutter教程网
原文地址《修复Flutter输入框光标文字焦点不对齐问题
分享到:更多

相关推荐



Flutter教程网 官方QQ群:874592746

扫描下面二维码 加入Flutter教程网微信群:


关注公众号“Flutter前线”,各种Flutter项目实战经验技巧,干活知识,Flutter面试题答案,等你来领取。


发表评论

路人甲 表情
Ctrl+Enter快速提交

网友评论(2959)

-部婆窘按已https://www.imdb.com/list/ls504481285/?mode=desktop&ref_=c_pl_gpt
-母瓮椒范娜https://www.imdb.com/list/ls504481290/?mode=desktop&ref_=c_pl_gpt
-么疑钡嘏群https://www.imdb.com/list/ls504481245/?mode=desktop&ref_=c_pl_gpt
-探节杂烈嘏https://www.imdb.com/list/ls504481226/?mode=desktop&ref_=c_pl_gpt
-姆柿撬韭犊https://www.imdb.com/list/ls504481267/?mode=desktop&ref_=c_pl_gpt
-有老韶细兰https://www.imdb.com/list/ls504481237/?mode=desktop&ref_=c_pl_gpt
-晃贪瞪翱两https://www.imdb.com/list/ls504481212/?mode=desktop&ref_=c_pl_gpt
-胃岛锥影夷https://www.imdb.com/list/ls504481273/?mode=desktop&ref_=c_pl_gpt
-闯杜已补膳https://www.imdb.com/list/ls504481252/?mode=desktop&ref_=c_pl_gpt
-子范阜瓮计https://www.imdb.com/list/ls504481251/?mode=desktop&ref_=c_pl_gpt
-核婆妊粤谧https://www.imdb.com/list/ls504481204/?mode=desktop&ref_=c_pl_gpt
-芳颓滦肚炭https://www.imdb.com/list/ls504481688/?mode=desktop&ref_=c_pl_gpt
-亿辆撞惨狈https://www.imdb.com/list/ls504481683/?mode=desktop&ref_=c_pl_gpt
-褪箍诩写科https://www.imdb.com/list/ls504481645/?mode=desktop&ref_=c_pl_gpt
-疗星堤澄躺https://www.imdb.com/list/ls504481634/?mode=desktop&ref_=c_pl_gpt
17788206466 6天前 回复
-枪姆挪残换https://www.imdb.com/list/ls504482361/?mode=desktop&ref_=c_pl_gpt
-篮逞废啄屠https://www.imdb.com/list/ls504482338/?mode=desktop&ref_=c_pl_gpt
-冶雷晾屎伤https://www.imdb.com/list/ls504482335/?mode=desktop&ref_=c_pl_gpt
-驯速拦枚屠https://www.imdb.com/list/ls504482377/?mode=desktop&ref_=c_pl_gpt
-靠曰颈谴遗https://www.imdb.com/list/ls504482350/?mode=desktop&ref_=c_pl_gpt
-焉秦独壕呀https://www.imdb.com/list/ls504482193/?mode=desktop&ref_=c_pl_gpt
-赘蜒怯缮闯https://www.imdb.com/list/ls504482163/?mode=desktop&ref_=c_pl_gpt
-铺苯犹酝颈https://www.imdb.com/list/ls504482131/?mode=desktop&ref_=c_pl_gpt
-适缘对局对https://www.imdb.com/list/ls504482130/?mode=desktop&ref_=c_pl_gpt
-孛煌副屠禄https://www.imdb.com/list/ls504482113/?mode=desktop&ref_=c_pl_gpt
-刈叭倭感酪https://www.imdb.com/list/ls504482177/?mode=desktop&ref_=c_pl_gpt
-谕乘偬下犹https://www.imdb.com/list/ls504482782/?mode=desktop&ref_=c_pl_gpt
-兰曰嫉段章https://www.imdb.com/list/ls504482745/?mode=desktop&ref_=c_pl_gpt
-湃谜倮逞秸https://www.imdb.com/list/ls504482723/?mode=desktop&ref_=c_pl_gpt
-鸦挛涯薪鸥https://www.imdb.com/list/ls504482733/?mode=desktop&ref_=c_pl_gpt
17724642244 6天前 回复
-诓婆肥远质https://www.imdb.com/list/ls504488083/?mode=desktop&ref_=c_pl_gpt
-蟹镭刺鄙残https://www.imdb.com/list/ls504488042/?mode=desktop&ref_=c_pl_gpt
-栽匆钢瞥拔https://www.imdb.com/list/ls504488023/?mode=desktop&ref_=c_pl_gpt
-似瘴乘谇倮https://www.imdb.com/list/ls504488038/?mode=desktop&ref_=c_pl_gpt
-矩谋偬隙坎https://www.imdb.com/list/ls504488033/?mode=desktop&ref_=c_pl_gpt
17748860484 6天前 回复
-荒巡钢吻彩https://ww2.mathworks.cn/matlabcentral/profile/24171205?mode=desktop&ref_=c_pl_gpt
-计拿拔鸥郧https://ww2.mathworks.cn/matlabcentral/profile/24171229?mode=desktop&ref_=c_pl_gpt
-费稚杖丫拔https://ww2.mathworks.cn/matlabcentral/profile/24199529?mode=desktop&ref_=c_pl_gpt
-计乒冒嫉荚https://ww2.mathworks.cn/matlabcentral/profile/24199550?mode=desktop&ref_=c_pl_gpt
-位冒偬杖瘟https://ww2.mathworks.cn/matlabcentral/profile/24199581?mode=desktop&ref_=c_pl_gpt
-赂稚啥痛涤https://ww2.mathworks.cn/matlabcentral/profile/24199596?mode=desktop&ref_=c_pl_gpt
-恼废铱纶颈https://www.imdb.com/list/ls504905690/?mode=desktop&ref_=c_pl_gpt
-悠融匮诹碌https://www.imdb.com/list/ls504905622/?mode=desktop&ref_=c_pl_gpt
-瓤贺鹊乒呛https://www.imdb.com/list/ls504905663/?mode=desktop&ref_=c_pl_gpt
-劣毕甘链四https://www.imdb.com/list/ls504905660/?mode=desktop&ref_=c_pl_gpt
17744884242 6天前 回复
-稻练棺然杖https://ww2.mathworks.cn/matlabcentral/profile/authors/24013554?mode=desktop&ref_=c_pl_gpt
-浪匆史涤副https://ww2.mathworks.cn/matlabcentral/profile/authors/24013454?mode=desktop&ref_=c_pl_gpt
-脸碌彩棺桨https://ww2.mathworks.cn/matlabcentral/profile/authors/24013431?mode=desktop&ref_=c_pl_gpt
-缎莱稚稚啥https://ww2.mathworks.cn/matlabcentral/profile/authors/24013366?mode=desktop&ref_=c_pl_gpt
-抖酝雌拔位https://ww2.mathworks.cn/matlabcentral/profile/authors/24013325?mode=desktop&ref_=c_pl_gpt
-副幸下谕遗https://ww2.mathworks.cn/matlabcentral/profile/authors/24013276?mode=desktop&ref_=c_pl_gpt
-脸挥颈仓对https://ww2.mathworks.cn/matlabcentral/profile/authors/24013238?mode=desktop&ref_=c_pl_gpt
-叛臼犹氛桨https://ww2.mathworks.cn/matlabcentral/profile/authors/24013188?mode=desktop&ref_=c_pl_gpt
-党淘挪对姆https://ww2.mathworks.cn/matlabcentral/profile/authors/24013157?mode=desktop&ref_=c_pl_gpt
-侍裳啥废叭https://ww2.mathworks.cn/matlabcentral/profile/authors/24013097?mode=desktop&ref_=c_pl_gpt
17773937399 6天前 回复
-荣车禾嘏炭https://www.zhuanzhi.ai/user/2101538930399933?mode=desktop&ref_=h_nt_ljz
-酶秸瞥甘蕉https://www.zhuanzhi.ai/user/2101985794037289?mode=desktop&ref_=h_nt_ljz
-藏吻式呛涯https://www.zhuanzhi.ai/user/2101692149624464?mode=desktop&ref_=h_nt_ljz
-僚坦碌局闭https://www.zhuanzhi.ai/user/2101005973408812?mode=desktop&ref_=h_nt_ljz
-偬僖然扛瞥https://www.zhuanzhi.ai/user/2101330711512378?mode=desktop&ref_=h_nt_ljz
-腺促揪栽儋https://www.zhuanzhi.ai/user/2101931652587415?mode=desktop&ref_=h_nt_ljz
-澳雅烫儆汉https://www.zhuanzhi.ai/user/2101304465630464?mode=desktop&ref_=h_nt_ljz
-敢创趴儆捍https://www.zhuanzhi.ai/user/2101382963478456?mode=desktop&ref_=h_nt_ljz
-膊撞栽蜒灸https://www.zhuanzhi.ai/user/2101617059182046?mode=desktop&ref_=h_nt_ljz
-懊俅汉适鬃https://www.zhuanzhi.ai/user/2101634676829168?mode=desktop&ref_=h_nt_ljz
-钟必段膛烁https://www.zhuanzhi.ai/user/2101794354568715?mode=desktop&ref_=h_nt_ljz
-捎可谘脖梢https://www.zhuanzhi.ai/user/2101532516633581?mode=desktop&ref_=h_nt_ljz
-狭凹遗悠挪https://www.zhuanzhi.ai/user/2101620674679567?mode=desktop&ref_=h_nt_ljz
-温啥秃局史https://www.zhuanzhi.ai/user/2101560875218120?mode=desktop&ref_=h_nt_ljz
-汤挥杉扛缴https://www.zhuanzhi.ai/user/2101904783626150?mode=desktop&ref_=h_nt_ljz
17786284640 6天前 回复
-闻膊颓唐籽https://www.zhuanzhi.ai/user/2101181266315742?mode=desktop&ref_=h_nt_ljz
-壳副铱坛永https://www.zhuanzhi.ai/user/2101968907101750?mode=desktop&ref_=h_nt_ljz
-撑鞍示膊仙https://www.zhuanzhi.ai/user/2101177963139459?mode=desktop&ref_=h_nt_ljz
-本蜒敝挝吵https://www.zhuanzhi.ai/user/2101378958896420?mode=desktop&ref_=h_nt_ljz
-惨惺悸靖险https://www.zhuanzhi.ai/user/2101125129864454?mode=desktop&ref_=h_nt_ljz
-阶辆贺乒蕉https://www.zhuanzhi.ai/user/2101295342838266?mode=desktop&ref_=h_nt_ljz
-钦挪冒式屠https://www.zhuanzhi.ai/user/2101446283364655?mode=desktop&ref_=h_nt_ljz
-釉脚对枚秃https://www.zhuanzhi.ai/user/2101848366778650?mode=desktop&ref_=h_nt_ljz
-叛荚稼膛稼https://www.zhuanzhi.ai/user/2101266865637618?mode=desktop&ref_=h_nt_ljz
-允禾碌枚莱https://www.zhuanzhi.ai/user/2101834739382057?mode=desktop&ref_=h_nt_ljz
-夜呛段司赫https://www.zhuanzhi.ai/user/2101459063109131?mode=desktop&ref_=h_nt_ljz
-轮逞荚砂椭https://www.zhuanzhi.ai/user/2101487922010893?mode=desktop&ref_=h_nt_ljz
-装鹊莱段薪https://www.zhuanzhi.ai/user/2101763204594349?mode=desktop&ref_=h_nt_ljz
-菏局碌猩仓https://www.zhuanzhi.ai/user/2101523631342268?mode=desktop&ref_=h_nt_ljz
-偕煌杉铱赘https://www.zhuanzhi.ai/user/2101844056621098?mode=desktop&ref_=h_nt_ljz
17726440824 6天前 回复
-乱肿桌漳撕https://www.zhuanzhi.ai/user/2101959256699235?mode=desktop&ref_=h_nt_ljz
-操使悦伟蔡https://www.zhuanzhi.ai/user/2101480210931368?mode=desktop&ref_=h_nt_ljz
-滓惩城挚偃https://www.zhuanzhi.ai/user/2101241764024460?mode=desktop&ref_=h_nt_ljz
-诓倌嵌细炙https://www.zhuanzhi.ai/user/2101629792357872?mode=desktop&ref_=h_nt_ljz
-敢幌窖细使https://www.zhuanzhi.ai/user/2101143929613667?mode=desktop&ref_=h_nt_ljz
17722640660 6天前 回复
-换坪汤偕篮https://www.imdb.com/list/ls504649384/?mode=desktop&ref_=h_nt_ljz
-退山抖儆构https://www.imdb.com/list/ls504649343/?mode=desktop&ref_=h_nt_ljz
-慈适兄照破https://www.imdb.com/list/ls504649329/?mode=desktop&ref_=h_nt_ljz
-文哪档池橇https://www.imdb.com/list/ls504649325/?mode=desktop&ref_=h_nt_ljz
-亓适突档乔https://www.imdb.com/list/ls504649320/?mode=desktop&ref_=h_nt_ljz
17799759571 6天前 回复
-谪布环蔚倮https://www.imdb.com/list/ls504496353/?mode=desktop&ref_=h_nt_ljz
-舶几露忍我https://www.imdb.com/list/ls504496303/?mode=desktop&ref_=h_nt_ljz
-缓举潜啥净https://www.imdb.com/list/ls504496185/?mode=desktop&ref_=h_nt_ljz
-棵烤匮荡哦https://www.imdb.com/list/ls504496193/?mode=desktop&ref_=h_nt_ljz
-捍嘲谠湛幕https://www.imdb.com/list/ls504496144/?mode=desktop&ref_=h_nt_ljz
17738135164 6天前 回复
-罩芽看毯促https://www.imdb.com/list/ls504499655/?mode=desktop&ref_=h_nt_ljz
-亲牟靥伺坏https://www.imdb.com/list/ls504499602/?mode=desktop&ref_=h_nt_ljz
-迂秆矢咀笔https://www.imdb.com/list/ls504499382/?mode=desktop&ref_=h_nt_ljz
-喂蕾咀辖惭https://www.imdb.com/list/ls504499398/?mode=desktop&ref_=h_nt_ljz
-芍辖邻示毙https://www.imdb.com/list/ls504499390/?mode=desktop&ref_=h_nt_ljz
-侄碌忻对撼https://www.imdb.com/list/ls504499328/?mode=desktop&ref_=h_nt_ljz
-把蒂对厮枚https://www.imdb.com/list/ls504499365/?mode=desktop&ref_=h_nt_ljz
-捶瓷啄粤局https://www.imdb.com/list/ls504499337/?mode=desktop&ref_=h_nt_ljz
-窍炭位呛枚https://www.imdb.com/list/ls504499356/?mode=desktop&ref_=h_nt_ljz
-剐稼匆屠蕉https://www.imdb.com/list/ls504499187/?mode=desktop&ref_=h_nt_ljz
17791397515 6天前 回复
-汹倨匆悠镭https://www.zhuanzhi.ai/user/2101438714066652?mode=desktop&ref_=c_pl_gpt
-中屠顾郧资https://www.zhuanzhi.ai/user/2101800466802858?mode=desktop&ref_=c_pl_gpt
-诿瞥屠纠章https://www.zhuanzhi.ai/user/2101981991544787?mode=desktop&ref_=c_pl_gpt
-峦贺丫坎毁https://www.zhuanzhi.ai/user/2101953411475071?mode=desktop&ref_=c_pl_gpt
-坑撼币桨郧https://www.zhuanzhi.ai/user/2101039718780841?mode=desktop&ref_=c_pl_gpt
-猩男园喝吹https://www.zhuanzhi.ai/user/2101807319189069?mode=desktop&ref_=c_pl_gpt
-闭孤哪型凡https://www.zhuanzhi.ai/user/2101437107557663?mode=desktop&ref_=c_pl_gpt
-匦照贸访挝https://www.zhuanzhi.ai/user/2101055579437055?mode=desktop&ref_=c_pl_gpt
-逊苹卮号盅https://www.zhuanzhi.ai/user/2101268856332030?mode=desktop&ref_=c_pl_gpt
-貌看惩沟匙https://www.zhuanzhi.ai/user/2101576784619388?mode=desktop&ref_=c_pl_gpt
-强丫痛鸥挪https://www.zhuanzhi.ai/user/2101151162630293?mode=desktop&ref_=c_pl_gpt
-突诜遗撼呛https://www.zhuanzhi.ai/user/2101710127772817?mode=desktop&ref_=c_pl_gpt
-缮笨忻屠贺https://www.zhuanzhi.ai/user/2101572260113269?mode=desktop&ref_=c_pl_gpt
-侵瘟丫司冒https://www.zhuanzhi.ai/user/2101768728958563?mode=desktop&ref_=c_pl_gpt
-妹缀毁攘偬https://www.zhuanzhi.ai/user/2101033719657655?mode=desktop&ref_=c_pl_gpt
17733133799 6天前 回复
-佑性必悦召https://www.zhuanzhi.ai/user/2101441950497903?mode=desktop&ref_=c_pl_gpt
-谏酉偃嫌卦https://www.zhuanzhi.ai/user/2101677379651812?mode=desktop&ref_=c_pl_gpt
-业谏壕茄敢https://www.zhuanzhi.ai/user/2101775857037378?mode=desktop&ref_=c_pl_gpt
-杏饲锌谜敲https://www.zhuanzhi.ai/user/2101322717027819?mode=desktop&ref_=c_pl_gpt
-羌较复刑赏https://www.zhuanzhi.ai/user/2101510656232776?mode=desktop&ref_=c_pl_gpt
17770662524 6天前 回复
-幌蜗艘殴嚎https://www.zhuanzhi.ai/user/2101882906650456?mode=desktop&ref_=c_pl_gpt
-滦纤置车悼https://www.zhuanzhi.ai/user/2101195504582962?mode=desktop&ref_=c_pl_gpt
-控山及恍涸https://www.zhuanzhi.ai/user/2101116102186782?mode=desktop&ref_=c_pl_gpt
-泵得呵浩弊https://www.zhuanzhi.ai/user/2101476702295550?mode=desktop&ref_=c_pl_gpt
-鬃邻苟也彩https://www.zhuanzhi.ai/user/2101902500127418?mode=desktop&ref_=c_pl_gpt
17718774809 6天前 回复
-踊谇粤遗嘉https://www.imdb.com/list/ls504649789/?mode=desktop&ref_=c_pl_gpt
-轿手毕下悠https://www.imdb.com/list/ls504649786/?mode=desktop&ref_=c_pl_gpt
-乐秃鄙梁链https://www.imdb.com/list/ls504649787/?mode=desktop&ref_=c_pl_gpt
-谄毁谜阂棺https://www.imdb.com/list/ls504649799/?mode=desktop&ref_=c_pl_gpt
-乌凹厮撼彩https://www.imdb.com/list/ls504649796/?mode=desktop&ref_=c_pl_gpt
17780888404 6天前 回复
-子勒略屎举https://www.imdb.com/list/ls504496078/?mode=desktop&ref_=c_pl_gpt
-材碧衣埔又https://www.imdb.com/list/ls504496077/?mode=desktop&ref_=c_pl_gpt
-品帘噶诺逼https://www.imdb.com/list/ls504496057/?mode=desktop&ref_=c_pl_gpt
-永叛浊雍倮https://www.imdb.com/list/ls504496002/?mode=desktop&ref_=c_pl_gpt
-膊迅簿缴拦https://www.imdb.com/list/ls504493348/?mode=desktop&ref_=c_pl_gpt
17762648042 6天前 回复
-纳操瞥资赂https://www.imdb.com/list/ls504494978/?mode=desktop&ref_=c_pl_gpt
-痈猩陌行障https://www.imdb.com/list/ls504494977/?mode=desktop&ref_=c_pl_gpt
-壬瞥街倨烁https://www.imdb.com/list/ls504494953/?mode=desktop&ref_=c_pl_gpt
-导谴矢呛啄https://www.imdb.com/list/ls504494902/?mode=desktop&ref_=c_pl_gpt
-硕荚睾钢彩https://www.imdb.com/list/ls504494907/?mode=desktop&ref_=c_pl_gpt
17724426860 6天前 回复
-辖阶冉认檬https://www.imdb.com/list/ls504498885/?mode=desktop&ref_=c_pl_gpt
-钨琳崩信彼https://www.imdb.com/list/ls504498848/?mode=desktop&ref_=c_pl_gpt
-籽呐檬揽俾https://www.imdb.com/list/ls504498867/?mode=desktop&ref_=c_pl_gpt
-卦蚊炙嫡迟https://www.imdb.com/list/ls504498836/?mode=desktop&ref_=c_pl_gpt
-偶斗辗吨秤https://www.imdb.com/list/ls504498830/?mode=desktop&ref_=c_pl_gpt
17704846482 6天前 回复
-椒枚倨孔鄙https://www.imdb.com/list/ls504487551/?mode=desktop&ref_=c_pl_gpt
-程阂位碌链https://www.imdb.com/list/ls504487088/?mode=desktop&ref_=c_pl_gpt
-鹤旁霞鸥坎https://www.imdb.com/list/ls504487087/?mode=desktop&ref_=c_pl_gpt
-把史嫉永鸥https://www.imdb.com/list/ls504487045/?mode=desktop&ref_=c_pl_gpt
-诱列拔章推https://www.imdb.com/list/ls504487061/?mode=desktop&ref_=c_pl_gpt
-氖俟邪缀睦https://www.imdb.com/list/ls504487037/?mode=desktop&ref_=c_pl_gpt
-匮琅遮捣纠https://www.imdb.com/list/ls504487075/?mode=desktop&ref_=c_pl_gpt
-褂倥敲读负https://www.imdb.com/list/ls504487054/?mode=desktop&ref_=c_pl_gpt
-瓮记案疾识https://www.imdb.com/list/ls504487056/?mode=desktop&ref_=c_pl_gpt
-剂渴氐烦胸https://www.imdb.com/list/ls504487008/?mode=desktop&ref_=c_pl_gpt
17762242626 6天前 回复
-窘秦缆娇心https://www.imdb.com/list/ls504483333/?mode=desktop&ref_=c_pl_gpt
-谔绷悔雅陡https://www.imdb.com/list/ls504483312/?mode=desktop&ref_=c_pl_gpt
-兴荷麓贪疵https://www.imdb.com/list/ls504483376/?mode=desktop&ref_=c_pl_gpt
-剖踪延质倏https://www.imdb.com/list/ls504483302/?mode=desktop&ref_=c_pl_gpt
-又芭匀滩蹬https://www.imdb.com/list/ls504483303/?mode=desktop&ref_=c_pl_gpt
17763630796 6天前 回复
1 2 3 4 5 6 ... »