본문 바로가기

InputDecoration5

Flutter 플러터 - 텍스트 필드 힌트 색상 변경 방법?, Flutter - How to change TextField hint color? 질문 I'm a bit confused how to change the hint color of the textfield. Someone can guide me how to do it.Thanks child: TextField( style: TextStyle(fontSize: 20), decoration: InputDecoration( hintText: "Password", border: new OutlineInputBorder( borderSide: new BorderSide( color: Colors.teal, ), ), prefixIcon: const Icon( Icons.security, color: Colors.white, ), ), ), 답변 당신은 InputDecoration에서 hintSt.. 2023. 6. 24.
Flutter 텍스트 필드 테두리 색상을 변경할 수 없습니다., Not able to change TextField Border Color 질문 저는 TextField의 테두리 색상을 BorderSide를 사용하여 변경하려고 시도했지만 작동하지 않습니다. 아래는 제 코드입니다. new TextField( decoration: new InputDecoration( border: new OutlineInputBorder( borderSide: new BorderSide(color: Colors.teal) ), hintText: 'Tell us about yourself', helperText: 'Keep it short, this is just a demo.', labelText: 'Life story', prefixIcon: const Icon(Icons.person, color: Colors.green,), prefixText: ' ', s.. 2023. 5. 28.
Flutter TextField 위젯에 Clear 버튼을 추가하는 방법, How to add clear button to TextField Widget 질문 TextField에 클리어 버튼을 추가하는 올바른 방법이 있나요? Material design 가이드라인에서 보는 것처럼: 찾아본 결과, InputDecoration의 suffixIcon에 클리어 IconButton을 설정하는 것이 맞는 방법인가요? 답변 출력: 변수를 만드세요 var _controller = TextEditingController(); 그리고 TextField를 추가하세요: TextField( controller: _controller, decoration: InputDecoration( hintText: '메시지를 입력하세요', suffixIcon: IconButton( onPressed: _controller.clear, icon: Icon(Icons.clear), ), ), ) 2023. 5. 18.
Flutter 플러터에서 TextField 하단의 글자 수 카운터를 숨기는 방법은 무엇인가요?, How can I hide letter counter from bottom of TextField in Flutter 질문 Flutter에서 작은 문제를 마주하고 있습니다. 보시다시피, TextField의 maxLength를 1로 설정했지만, 텍스트 카운터의 하단 레이블을 숨길 수 없습니다. 답변 TextField 또는 TextFormField 위젯에서 maxLength 속성을 사용하면 카운터 값을 숨기려면 다음을 시도하십시오. TextField( decoration: InputDecoration( hintText: "Email", counterText: "", ), maxLength: 40, ), 여기서 나는 빈 값으로 InputDecoration 속성 내에 counterText 속성을 설정했습니다. 도움이 되기를 바랍니다. 2023. 5. 16.