swiftui-list

Navigation View background Color

旧巷老猫 提交于 2020-08-09 09:05:21
问题 I'm try to set a background color on my SwiftUi List, as for my post here: SwiftUI Background List color I found a solution inserting the following code as init() init() { UITableView.appearance().backgroundColor = UIColor.clear UITableViewCell.appearance().backgroundColor = .clear } my issue now is ... as soon I insert a Navigation Link the background color again became white. how to set the color to .clear to the NavigationView? I have tried to .foregroundColor(.clear) but noting... what I

Navigation View background Color

泪湿孤枕 提交于 2020-08-09 09:04:51
问题 I'm try to set a background color on my SwiftUi List, as for my post here: SwiftUI Background List color I found a solution inserting the following code as init() init() { UITableView.appearance().backgroundColor = UIColor.clear UITableViewCell.appearance().backgroundColor = .clear } my issue now is ... as soon I insert a Navigation Link the background color again became white. how to set the color to .clear to the NavigationView? I have tried to .foregroundColor(.clear) but noting... what I

Disable Scrolling in SwiftUI List/Form

蓝咒 提交于 2020-08-07 09:46:17
问题 Lately, I have been working on creating a complex view that allows me to use a Picker below a Form. In every case, the Form will only have two options, thus not enough data to scroll downwards for more data. Being able to scroll this form but not Picker below makes the view feel bad. I can't place the picker inside of the form or else SwiftUI changes the styling on the Picker. And I can't find anywhere whether it is possible to disable scrolling on a List/Form without using: .disable

Disable Scrolling in SwiftUI List/Form

瘦欲@ 提交于 2020-08-07 09:42:24
问题 Lately, I have been working on creating a complex view that allows me to use a Picker below a Form. In every case, the Form will only have two options, thus not enough data to scroll downwards for more data. Being able to scroll this form but not Picker below makes the view feel bad. I can't place the picker inside of the form or else SwiftUI changes the styling on the Picker. And I can't find anywhere whether it is possible to disable scrolling on a List/Form without using: .disable

SwiftUI Nested ForEach causes unexpected ordering

馋奶兔 提交于 2020-08-07 05:06:16
问题 I am using two ForEach() in a nested way, one to display the sections, and the other to display the individual cells of the List view. My problem is that the iterator variable from the first ForEach is behaving in a very weird way when accessing it in the second ForEach . In this gif I attached, the first variable behind Round ( ri in the code snippet below) changes its value sometimes when I scroll up or down. However the value of this variable is always the same inside the first ForEach ,

SwiftUI Nested ForEach causes unexpected ordering

若如初见. 提交于 2020-08-07 05:06:04
问题 I am using two ForEach() in a nested way, one to display the sections, and the other to display the individual cells of the List view. My problem is that the iterator variable from the first ForEach is behaving in a very weird way when accessing it in the second ForEach . In this gif I attached, the first variable behind Round ( ri in the code snippet below) changes its value sometimes when I scroll up or down. However the value of this variable is always the same inside the first ForEach ,

Nested ForEach (and List) in Views give unexpected results

时间秒杀一切 提交于 2020-07-20 08:36:28
问题 Doing a ForEach within another ForEach in a SwiftUI View produces unexpected results - almost like they are stepping on each other's counters. Not clear as to what's happening. I need to display multi branched arrays and have tried a number of variants but keep running into the same problem I have a few projects where this has come up. Tries using ranges (0.. Is this just a beta issue or am I missing something? I've included an example project that demonstrated the problem. using XCode 11

How to get the index of the element in the List in SwiftUI when the List is populated with the array?

本秂侑毒 提交于 2020-07-13 15:29:24
问题 In my SwiftUI app, I have a list of items. I'm using the array of MenuItems to fill in the list struct MenuItem: Identifiable, Equatable { var id = UUID() var text: String } struct MenuView: View { var menuItems = [MenuItem(text:"Text1"),MenuItem(text:"Text2")] var body: some View { List { ForEach(menuItems) {textItem in Text(textItem.text) } } } } The question is, how to get the index of textItem? For example if I want to have different row colors for odd and even rows, or if I need to