본문 바로가기

DropdownButton3.2

Flutter 플러터에서 DropdownButtons와 DropdownMenuItems를 어떻게 사용자 정의해야 하나요?, How should I customize DropdownButtons and DropdownMenuItems in Flutter? 질문 기본 DropdownButton은 DropdownMenuItems와 함께 연결되어 연한 회색 드롭다운을 반환합니다. 드롭다운을 어떻게 사용자 정의할 수 있을까요? (예: 배경색, 드롭다운 너비) DropdownButton과 DropdownMenuItem의 style 속성을 변경할 수 있습니다. 아래와 같이: return new DropdownButton( value: ..., items: ..., onChanged: ..., style: new TextStyle( color: Colors.white, ), ); 하지만 이렇게 해도 드롭다운의 배경색은 변경되지 않습니다. DropdownMenu를 복사하고 확장해야 할까요? Flutter는 가까운 미래에 이 위젯에 대한 사용자 정의 기능을 추가할 계획이.. 2023. 12. 15.
Flutter 플러터에서 드롭다운 버튼의 너비를 전체 너비로 조정하고 드롭다운 화살표 아이콘을 조정합니다., Full width DropdownButton with adjust dropdown arrow icon in Flutter 질문 Flutter에서는 전체 너비로 DropdownButton을 추가하고 드롭다운 화살표 아이콘도 조정해야 했습니다. 그러나 많은 시도를 해봤지만 너비가 전체로 확장되지 않았습니다. DropdownButton에 대한 코드는 다음과 같습니다: new Expanded( child: new Column( children: [ new DropdownButton( items: [ new DropdownMenuItem(child: new Text("Abc")), new DropdownMenuItem(child: new Text("Xyz")), ], hint: new Text("도시 선택"), onChanged: null ) ] ), flex: 1, ) 답변 Just adding isExpanded:true to .. 2023. 8. 12.