In the last update of SwiftUI, there we have got a couple of new DatePicker styles. I was trying to modify the default appearance of DatePicker. However could not find a way to do so.
This is the default view right now. I would like to resize the button and also would like to change the background colour (like making it completely transparent).
Could any one please suggest a proper way to do these modification?
Related
How can I change the focus color of a selected element in WatchOS7 with swiftUI. Here's my example below with a Picker whose focus color is green (the default one) but I want to change it to blue to be consistant with my app layout.
I search over the internet and stackoverflow but did not find andy solution to this. Is it possible to do it in SwiftUI.
That's the focus color and you cannot change it. At least no with standard view modifiers like .accentColor, .tint, etc.
You can try to hide it by overlying another view (like in this response), for example, or try to reach to UIKit using instrospection.
Probably it's best to be at peace with the fact that it's system behavior.
Maybe you should try using .accentColor modifier to the picker.
I want my date picker to show the text right aligned as it is contained in an right aligned tableView. I'm using the iOS 14 default style were selecting the date picker ends up in a popover to select the date, so by default the label is left aligned when the popover is not showing.
I tried using datePicker.contentHorizontalAlignment = .right but nothing is changing.
Is there any other way to change the alignment as it is looking strange that way?
There's no explicit way to do this, since the widget itself seems to not honor the content alignment; BUT: I have found a way to do this that works with iOS currently. At some point the date picker creates a UILabel, seemingly with a 'leading' constraint, no matter what content alignment. But, we can override what that 'leading' means with clever use of semanticContentAttribute.
datePicker.semanticContentAttribute = .forceRightToLeft
datePicker.subviews.first?.semanticContentAttribute = .forceRightToLeft
This code can't crash the app, even if the widget changes, it safely access the first subview and sets an official API on it.
It does work with iOS 14.2; and
Supposing, in iOS 14.3 or 15+, Apple changes the widget structure such that this trick doesn't work, perhaps because there's another nested view, all that could happen is the layout goes back to the default.
It's possible only the second line of code is necessary, but my first attempt was with the first line, which didn't work, so I added the second line.
I have a requirement, where I need to show few tabs on selection of a value from a drop down.
I have done this in classic UI. But not sure how to proceed for Touch UI. I know that we can use JQuery, Can anyone let me know the approach I can use.
Its fairly simple, look at the OOTB List Component /libs/foundation/components/list. The selection dropdown is defined - /libs/foundation/components/list/cq:dialog/content/items/column/items/listFrom, look at property class and cq-dialog-dropdown-showhide-target these are used to manage hide and show.
Now from here look at the dropdown values under - /libs/foundation/components/list/cq:dialog/content/items/column/items/listFrom/items these values trigger the hide and show mapping to property showhidetargetvalue as in /libs/foundation/components/list/cq:dialog/content/items/column/items/setDescendants
I am making a vertical Menu using GWT MenuBar and selection of particular MenuItem shows content on the right, I am trying to make something similar to TabPanel, but with Tabs on left instead of being on top. Now, since I've got the Menu items and actions in place, I want to remove the effect of hovering over and changing color, and keep that menu item selected which was clicked last and whose content is loaded on the right.
I am open to any comments, if you have a better solution to implement this, using some other components(with-in) GWT, please drop in a comment with your suggestions, I'll really appreciate that.
Or if you can just tell me how can I disable this effect, of hovering and sticking to only that selection, That would be awesome too..
Thanks to everyone, taking time to read this and suggesting a solution.
It's all defined in the CSS of your GWT's theme (probably the default one), so it's a matter of overriding those styles - make sure it's not the other way around :) Inspect the code with a tool like Firebug to see what's exactly being set and change that.
I have a table view in which i am reordering my cells
Now the issue is that the client doesn't like the icon of the reorder (i.e. 3 horizontal lines)
Is there any way you can help out.
First of all I want to know Is it possible at all?
You cannot change the standard icon. But you should be able to use a custom button and start/end editing mode programmatically (haven't tested this).
If it isn't a very custom UI at all, tell him that messing with standard icons/behavior is the best way to make users frustrated.