본문 바로가기

listview15

Flutter에서 Row()의 배경색을 설정하는 방법은 무엇인가요?, How to set the background color of a Row() in Flutter? 질문 I'm trying to set up a background color for a Row() widget, but Row itself has no background color or color attribute. I've been able to set the background color of a container to grey, right before the purple-backgrounded text, but the text itself does not fill the background completely and the following spacer does not take any color at all. So how can I have the Row background set to the ".. 2023. 9. 21.
Flutter 리스트뷰를 SingleChildScrollView 안에 배치하되 서로 따로 스크롤되지 않도록 하는 방법은 무엇인가요?, how to place a listview inside a SingleChildScrollView but prevent them from scrolling separately? 질문 나는 다음과 같은 위젯 트리를 가지고 있습니다: SingleChildScrollView Column Container ListView(또는 GridView) 문제는 위와 같은 위젯 트리일 때, 오류가 발생한다는 것입니다: NEEDS PAINT 그래서 위젯 트리를 다음과 같이 변경했습니다: Column Container ListView(또는 GridView) 하지만 이 상황에서 ListView 또는 GridView 부분이 별도로 스크롤되고 있으며, 전체 위젯 트리를 스크롤하고 싶습니다. 어떻게 해야 할지 어떻게 생각하시나요? 답변 당신은 첫 번째 위젯 트리를 사용하고 다음 변경 사항을 적용할 수 있습니다: 모든 ListView와 GridView에 shrinkWrap: true를 설정하세요. 이렇게 하.. 2023. 8. 12.
Flutter 플러터 ListView 레이지 로딩, Flutter ListView lazy loading 질문 How can I realize items lazy loading for endless listview? I want to load more items by network when user scroll to the end of listview. 답변 당신은 ScrollController를 들을 수 있습니다. ScrollController에는 스크롤 오프셋과 ScrollPosition 목록과 같은 유용한 정보가 있습니다. 당신의 경우에는 controller.position에 흥미로운 부분이 있습니다. 이는 현재 보이는 ScrollPosition을 나타냅니다. 이는 스크롤 가능한 부분을 나타냅니다. ScrollPosition은 스크롤 가능한 부분 내부의 위치에 대한 정보를 포함합니다. 예를 들어 ext.. 2023. 6. 23.
Flutter 플러터: 수평 리스트 뷰에서의 최소 높이, Flutter: Minimum height on horizontal list view 질문 저는 Flutter에서 항목의 가로 스크롤링 목록을 만들려고 하고, 그 목록이 자식에 따라 필요한 높이만 차지하도록하고 싶습니다. 디자인상으로 “ListView는 교차 방향에서 사용 가능한 공간에 맞게 확장하려고합니다” (Flutter docs에서) 이것은 뷰포트의 전체 높이를 차지한다는 것을 알 수 있습니다. 그러나 이것을하지 않도록하는 방법이 있습니까? 아마도 이와 유사한 것이 이상적입니다 (물론 작동하지 않는 것): new ListView( scrollDirection: Axis.horizontal, crossAxisSize: CrossAxisSize.min, children: [ new ListItem(), new ListItem(), // ... ], ); 저는 ListView를 높이가 고.. 2023. 6. 14.