I am currently working on 3 components(columns) picker in my app.
I want to put border line between 0 - 1 components and 1 - 2 components. It seems fairly fundamental thing but I cannot find a way to do so.
Is there anyone who knows how to make the lines?
Thank you
Try this code
picker.layer.borderColor = UIColor.whiteColor().CGColor
picker.layer.borderWidth = 1
swift-formatting-a-uipickerview
Related
I have following question, today i updated the 'charts' pod in my project and suddenly the chart is drawn wrong. I mean the bars are going below zero, and not starting at the zero line.
and before the update it looked like this:
(i know the second image is a grouped barchart)
but my problem is that in the new version the bars start at the bottom of the chartview, and in the old they started at the zero line.
i read that this was a bug in the old version and that it should look like this. Is it possible, to have the buggy design back because i liked it, or is it not supposed to look like this?
i tried using axisMinimum = 0 but that only moved the zero from the yAxxis to the bottom.
groupedBarChart.xAxis.labelPosition = XAxis.LabelPosition.bottom
groupedBarChart.chartDescription?.text = ""
groupedBarChart.backgroundColor = UIColor(red:0.980, green:0.898, blue:0.498, alpha: 1.000)
print(groupedBarChart.leftAxis.axisMinimum)
groupedBarChart.fitBars = true
this is the code i use to customize the chart.
Im looking forward to your answers and thanks in advance.
I am completely new to Swift but am loving my journey so far. I was wondering if anyone could help me with a slight issue of mine.
I am currently trying to print each item in an array to a different row on a UILabel.
I should be using a for loop but I am wondering how to structure the inside of the loop so that each item in the array prints on a separate line of the label.
As a bonus question, would a label even be the best way to display this? (Especially if the array has a lot of items). Maybe a ScrollView?
Thanks in advance for any responses. All help is appreciated.
The easiest way would be the following.
// Label will show as many lines as needed
label.numberOfLines = 0
// Join strings with new line characters so each string is a separate line
label.text = arrayOfStrings.joined(separator: "\n")
My annotation looks like this now:
As you can see the text is too long for it to be showed. How can i make a new sentence below? Or just make the annotation subtitle wider so i can see all the text?
I want it to say "Antal personer: 5. Riktning öst: 4. Riktning väst: 1."
But the best would be:
"Antal personer: 5
Riktning öst: 4
Riktning väst: 1"
I have not been able to find any information on how to make a new row in subtitle. I have seen something with /n but it does not work.
in iOS 9 we have a new property named detailCalloutAccessoryView
You can create a view and set as
annotationView.detailCalloutAccessoryView = tempView
Please check the link to get more details
MapKit iOS 9 detailCalloutAccessoryView usage
My requirement is to display the current double pages in following format:-
2-3
4-5
and I only done with displaying singe page at a time however there is a double page view.
like
2 at 2-3
4 at 4-5
Any idea how do I fetch these current double pages in expected format?
I know I can do it by using adding logic, but would be better if I do it with internal logic of turnjs.
because It can be happen only single page comes sometimes like cover page or last page. I am sure there must be a way to find by turnjs only.
Any help will be appreciated...
Thanks in Advance.
I found its solution.. There is an array with the name view that holds the page's numbers to display. If there is a page 1 it holds the value
view[0] =1
View [1]=0
Similarly if its a last page lets say page 12 then the value in view will be
View [0]=0
View [1]=12
And if we are at 4-5 pages then
View [0]=4
View [1]=5
Got the solution :)
To be more specific here you can use this property.
view
Eg.
var view = $("#flipbook").turn("view").join(" - ");
alert("Current view: "+view);
It will return like this.
0 - 1
2 - 3
.......
Read here: http://www.turnjs.com/docs/Property:_view
Any recommendations re which approach from a useability perspective for a user to configure one preference for my app, which is number of weeks - probably would make sense to allow it to be anywhere from 2 through to 25 say. So options which come to mind include:
type it in - but would need some validation
have a list to pick from (I assume by pushing on another TableView to the UINavigationStack) - but with 25 rows not sure about this (e.g. row 1 = "week 1", row 2 = "week 2" etc)
UIPicker wheel - but doesn't sound too good
other???
thanks
I would advice you to us a UIPickerView that shows when you tap to edit