TextField22 Flutter에서 텍스트 필드 내부의 값을 어떻게 변경하나요?, How do you change the value inside of a textfield flutter? 질문 사용자가 버튼을 클릭하면 정보가 채워지는 TextEditingController가 있습니다. Textfield 또는 TextFormField 내부의 텍스트를 변경하는 방법을 찾을 수 없습니다. 해결책이 있을까요? 답변 text 속성을 간단히 변경하십시오. TextField( controller: txt, ), RaisedButton(onPressed: () { txt.text = "My Stringt"; }), txt는 단지 TextEditingController일 뿐입니다. var txt = TextEditingController(); 2023. 5. 26. Python Django에서 null=True와 blank=True의 차이점은 무엇인가요?, What is the difference between null=True and blank=True in Django? 질문 장고에서 모델 필드를 추가할 때는 일반적으로 다음과 같이 작성합니다: models.CharField(max_length=100, null=True, blank=True) ForeignKey, DecimalField 등에도 동일하게 적용됩니다. 다음 중에서: null=True만 blank=True만 null=True 및 blank=True 다른 (CharField, ForeignKey, ManyToManyField, DateTimeField) 필드에 대해 각각 어떤 차이가 있으며, 옵션 1, 2 또는 3을 사용하는 장단점은 무엇인가요? 답변 null=True은 DB에서 해당 열을 NULL (대신 NOT NULL)로 설정합니다. DateTimeField 또는 ForeignKey와 같은 Django 필드.. 2023. 5. 25. 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. 이전 1 2 3 4 5 6 다음