我需要滾動但不需要滾動。此時,一些資料/專案顯示但最大資料已隱藏。那么如何克服/滾動所有資料項。我需要滾動但不需要滾動。此時,一些資料/專案顯示但最大資料已隱藏。那么如何克服/滾動所有資料項。我需要滾動但不需要滾動。此時,一些資料/專案顯示但最大資料已隱藏。那么如何克服/滾動所有資料項。我的源代碼如下:
body:
ListView(
children: [
ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
itemCount: _mOfferListRemoveDuplicate == null ? 0 : _mOfferListRemoveDuplicate.length,
// itemCount: _mOfferList == null ? 0 : _mOfferList.length,
itemBuilder: (BuildContext context, index) {
return Card(
margin: EdgeInsets.all(5.0),
elevation: 1,
child: SizedBox(
height: 100,
child: ListView(
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
_mOfferListRemoveDuplicate[index],
textAlign: TextAlign.left,
style: TextStyle(fontSize: 4.0, color: Colors.green,),
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
itemCount:
_mOfferList == null ? 0 : _mOfferList.length,
itemBuilder: (BuildContext context, index) {
return Column(
children: [
Text("" _mOfferList[index].offerTitle,style: TextStyle(fontSize: 5.0),)
],
);
}),
),
],
),
));
}),
],
));
uj5u.com熱心網友回復:
在每個 listview 和 listview.builder (期待第一個)使用此代碼:
physics: ScrollPhysics(),
shrinkWrap: true,
它必須作業
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/378010.html
上一篇:使用自定義Listview和logcat時Android應用程式崩潰不顯示任何內容
下一篇:限制惰性列中的專案
