This question already has an answer here:
UIDatePicker show only month and day
(1 answer)
Closed 4 years ago.
Please check image below. I need to create date picker like this in green box.
I have two questions regarding this.
Is it possible to create below date picker using UIDatePicker? I have tried all datePickerMode. There is no option like this.
Is there any third party framework for this?
Thanks in advance :)
You should use a UIPickerView (Which is different than a UIDatePicker) with only 1 component. You would provide the data for every row in that component as the Month/Day. A UIDatePicker is very basically a UIPickerView that always populates with dates and/or times.
If you're looking for a 3rd party library you can take a look at Awesome iOS and see if there's something there that's what you're looking for.
Related
This question already has answers here:
UISlider - missing features - snap, tooltip and ticks
(2 answers)
iOS UISLider with gradient layer
(1 answer)
Closed 4 years ago.
I am trying to create a UISlider with a track broken up into sections. Is it possible to break up the track and have each section be a different color? Rather than just min track and max track
Is it possible to break up the track and have each section be a different color?
When you want to know what a built-in interface object will do, consult the documentation (e.g. https://developer.apple.com/documentation/uikit/uislider). You will readily learn that the built-in slider control itself can't do what you describe. But you can. For example, you could make a clear track and put the sectioned view behind it, or create your own slider control that draws the way you want it. There are lots of online explanations about how to write a customized version of a slider.
This question already has answers here:
How to create radio buttons and checkbox in swift (iOS)?
(20 answers)
Closed 5 years ago.
I'm looking for a checkbox component in Swift. UISwitch seems not so handy because there I found no way to define a label for it.
Very good I find the component the iPhone used when turning on and off the personal hotspot. But I do not know what it is?
There's no native radio button in iOS. As you can see in iOS, Apple uses UISwitch as mention by Sweeper.
Now if you aim to achieve something like this, then you can make your own control or use some 3rd party open source libraries like VKCheckBox. https://github.com/vladislav-k/VKCheckbox
I've been using this custom control and you can integrate it by either Cocoapods or by merely importing its one and only class to your project.
No, there is no checkbox control available on iOS but i was achieve it using CZPicker view, it's allows to select single and multiple options from list
Please check this URL : https://github.com/chenzeyu/CZPicker
Thanks
I have cerated checkbox with uibutton subclass -- using image and title both and adjsuting title and image with title offset and image offset.
Put a property isSelected -- On DidSet I change the image of button for select/unselect.
2.On click of button I toggle the property isSelected
On click button I triger a delegate call back for get buttons selected/unselect state in view controller.
Hope It will help.
This question already has answers here:
How to add toggleBoldface option to a UITextView in iOS?
(2 answers)
Closed 5 years ago.
I have been searching for quite a while for a solution as to how to grant users the ability to underline, italicize and bold text in a UITextView but have not been able to find a solid solution. I have realized that I will need to use an NSAttributedString but am not sure as to how to create the UI and format the string so I am able to save it to a database. If you could point me in a proper direction that would be greatly appreciated. Thanks!
The UI is simply an ordinary editable UITextView with allowsEditingTextAttributes set to true.
How you save is up to you, but the most universal solution is probably to pull out the UITextView's attributedText, archive it into an NSData (now known as Data in Swift), and save it off.
I am developing a survey app using Xamarin and Mvvmcross. Can some one help with suggesting a way to build a View to display questionnaire. These questionnaire will be supplying from my View Model as a List of question with Question Text, Answer options. Based on a flag I need to prompt the questionnaire with input type as drop down or Text boxes. Number of questions can be vary.
In Android I achieved it using MvxGridView and Layout templates. But not sure how to do it in iOS.
You could look up UITableView or UICollectionView and UITextFields and UIPickerView
Wellcome to Xamarin, about your question you can just take look the code I wrote for others, it's a tableview include custom cell to display images, you can just modify the MyTableCell.cs class to display anything you want.
Custom cell tableview(Xamarin.iOS)
If you still need some help, just leave it here, I will check latter.
Hope it can help you.
This question already has answers here:
Making a drop down list using swift? [closed]
(5 answers)
Closed 7 years ago.
My idea is that, in order to provide to the user different options to choose it would be very interesting to include some type of IBOutlet with a drop down menu on it.
This is how it should be seen.
How is the best way to do this?
Any suggestion would be very appreciated.
Presuming that the down arrow is a button to trigger the drop-down that you've illustrated, the first suggestion that comes to mind is to create an IBAction for that button that presents a table view as a child view controller. This table view will list out the "different options".
You could always use a UIAlertController. Apple suggests that developers follow the same consistent design throughout the entire OS. As a plus, UIAlertController is pretty easy to use. (Beware though, UIAlertView is deprecated. Don't use it by mistake.)
You could also (if you have a lot of choices) use a UIPickerView.