![](/img/trans.png)
[英]In Flutter TextField when I have set the text directrion as 'Right to Left" , some symbols setting into beginning of the line
[英]When I set the textfield to the next line in Flutter, the text goes up
當我在文本字段中按 Enter 鍵時,我想去掉上升的字母。 我應該怎么辦?
這是代碼的一部分。
Container(
child: TextField(
textAlign: TextAlign.center,
autofocus: true,
// controller: myController,
onChanged: (value) {
// print('$value');
setState(() {
mainText = value;
});
},
keyboardType: TextInputType.multiline,
minLines: 1,
maxLines: 10,
decoration: InputDecoration(
focusedBorder: InputBorder.none,
enabledBorder: InputBorder.none,
hintText: "짧은 글귀를 집필해주세요",
hintStyle:
TextStyle(fontSize: 14, color: Colors.black),
),
),
)
根據您的提示文本,您只需要短文本,並且可以通過僅與單行文本字段集成來實現
Container(
child: TextField(
textAlign: TextAlign.center,
autofocus: true,
// controller: myController,
onChanged: (value) {
setState(() {
mainText = value;
});
},
keyboardType: TextInputType.text, // this is change
textInputAction: TextInputAction.done, // this is change
decoration: InputDecoration(
focusedBorder: InputBorder.none,
enabledBorder: InputBorder.none,
hintText: "짧은 글귀를 집필해주세요",
hintStyle: TextStyle(fontSize: 14, color: Colors.black),
),
),
)
對於多行文本:
keyboardType: TextInputType.multiline,
maxLines: 5,
textInputAction: TextInputAction.newline,
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.