From fee40442409edd36dbb4838bdd9717292220b484 Mon Sep 17 00:00:00 2001 From: dankito Date: Sun, 19 Jul 2020 20:27:24 +0200 Subject: [PATCH] Fixed that BankListItem didn't correctly resize to its content --- .../BankingiOSApp/ui/views/BankListItem.swift | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/ui/BankingiOSApp/BankingiOSApp/ui/views/BankListItem.swift b/ui/BankingiOSApp/BankingiOSApp/ui/views/BankListItem.swift index 55443c28..9ef5d0c3 100644 --- a/ui/BankingiOSApp/BankingiOSApp/ui/views/BankListItem.swift +++ b/ui/BankingiOSApp/BankingiOSApp/ui/views/BankListItem.swift @@ -15,10 +15,14 @@ struct BankListItem : View { Spacer() }.frame(height: 35) - List(bank.accounts, id: \.id) { account in - return BankAccountListItem(account: account) + VStack { + ForEach(0 ..< bank.accounts.count) { accountIndex in + BankAccountListItem(account: self.bank.accounts[accountIndex]) + } } - }.frame(minHeight: 70) + .padding(.leading, 18) + .padding(.trailing, 6.0) + } } } @@ -29,4 +33,4 @@ struct BankListItem_Previews: PreviewProvider { static var previews: some View { BankListItem(bank: previewBanks[0]) } -} \ No newline at end of file +}