picker

Appcompact DialogFragment single-choice checkmark color

柔情痞子 提交于 2021-02-18 06:42:07
问题 I have a problem. My activity has style <style name="MaterialTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <item name="colorPrimary">@color/action_bar_background</item> <item name="colorPrimaryDark">@color/action_bar_background</item> <item name="colorAccent">@color/action_bar_background</item> </style> also i have dialogFragment with simple single-choice chooser. @Override public Dialog onCreateDialog(final Bundle savedInstanceState) { final AlertDialog.Builder dialog = new

How do I change the appearance of the DatePicker in the SwiftUI framework to only months and years?

拥有回忆 提交于 2021-02-16 20:14:31
问题 I want to change the DatePicker's date view. I just want to get a month and year selection. I want to assign ObservedObject to a variable at each selection. My Code: @State private var date = Date() var body: some View { DatePicker("", selection: $date, in: Date()..., displayedComponents: .date) .labelsHidden() .datePickerStyle(WheelDatePickerStyle()) .onDisappear(){ let dateFormatter = DateFormatter() dateFormatter.dateFormat = "MM/yyyy" self.cardData.validThru = dateFormatter.string(from:

How do I make this Picker clip properly

こ雲淡風輕ζ 提交于 2021-02-11 13:09:54
问题 I create a set of side by side pickers in an HStack by calling the view below. The "control" area for each picker is much wider to the left of the picker than it should be. ".clipped()" is supposed to fix this, but it is not working. At some point when I was developing the code, it was working, but now I can't get it back. When I try to manipulate the pickers, I can move the rightmost one anywhere on the right 3 columns. The left column cannot be manipulated at all. What is going on here?

Picker ItemSource values not binding in a XAML ListView

梦想的初衷 提交于 2021-01-29 05:25:04
问题 Hoping you can advise as I've tried all methods to bind a picker in a Listview to my item source values using both code-behind and MVVM. The picker binding works outside of the ListView, but not inside - is this out of the box or just not possible? Please see my list below! code <ListView x:Name="TypesList" HeightRequest="53" BackgroundColor="White" IsGroupingEnabled="True" IsPullToRefreshEnabled="false" ItemsSource="{Binding Items}" IsRefreshing="{Binding IsBusy}" RefreshCommand="{Binding

SwiftUI: Picker doesn't update text in same view

十年热恋 提交于 2021-01-27 20:58:07
问题 I have this simple situation: struct User: Hashable, Identifiable { var id: Int var name: String func hash(into hasher: inout Hasher) { hasher.combine(id) } } let bob = User(id: 1, name: "Bob") let john = User(id: 2, name: "John") let users = [bob, john] struct ParentView: View { @State private var user: User? var body: some View { VStack(spacing: 0) { // Other elements in view... Divider() ChildPickerView(user: $user) Spacer() } } } struct ChildPickerView: View { @Binding var user: User? var

Why does this SwiftUI Picker code not work?

≯℡__Kan透↙ 提交于 2021-01-19 05:56:29
问题 Xcode: 11.2.1 The code below is for a simple form with two components; a Picker (to select a letter) and a Text (to display the selected letter). The code compiles and runs but, when a letter is selected it does not appear in the "Selected..." text. In addition, Xcode displays a (spurious?) run time warning the first time (only) a letter is selected.. struct ContentView: View { @State private var letter = "" private let letters = ["Alpha", "Bravo", "Charlie"] var body: some View {

Why does this SwiftUI Picker code not work?

北城余情 提交于 2021-01-19 05:55:02
问题 Xcode: 11.2.1 The code below is for a simple form with two components; a Picker (to select a letter) and a Text (to display the selected letter). The code compiles and runs but, when a letter is selected it does not appear in the "Selected..." text. In addition, Xcode displays a (spurious?) run time warning the first time (only) a letter is selected.. struct ContentView: View { @State private var letter = "" private let letters = ["Alpha", "Bravo", "Charlie"] var body: some View {

xamarin forms - two way binding with a picker - why cant I update a picker from code behind?

瘦欲@ 提交于 2020-11-29 23:51:21
问题 My products page only shows 'Product Name' and 'Quantity', quantity isdisplayed/ binded to the picker. For test purposes to get this working there is only 2 products loading from the VM. Wine 1 and wine 2. When the application loads, why is the picker empty with no value selected. When quantity for each item is set to 1, when loading from the VM Quantity is set to 1, the picker is just not updating when it initially loads, I know this because if I click on the empty picker and select 1.

xamarin forms - two way binding with a picker - why cant I update a picker from code behind?

陌路散爱 提交于 2020-11-29 23:50:55
问题 My products page only shows 'Product Name' and 'Quantity', quantity isdisplayed/ binded to the picker. For test purposes to get this working there is only 2 products loading from the VM. Wine 1 and wine 2. When the application loads, why is the picker empty with no value selected. When quantity for each item is set to 1, when loading from the VM Quantity is set to 1, the picker is just not updating when it initially loads, I know this because if I click on the empty picker and select 1.