簡體   English   中英

當 cursor 在 flutter 內時,如何使文本字段的邊框改變顏色

[英]how to make the border of a text field change color when the cursor is inside flutter

我想更改邊框的顏色,但僅當 cursor 在文本字段中時

這是目前的樣子

在這種情況下,您可以使用focusedBorder

TextFormField(
decoration: InputDecoration(
  border: OutlineInputBorder(),
  focusedBorder: OutlineInputBorder(
    borderRadius: BorderRadius.circular(12,),
    borderSide: BorderSide(
      color: Colors.pink,
    )
  )
),
),

你可以找到更多關於InputDecoration

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM