How to prevent CCLabelBMFont from updating position? - ios

Every time I change .string property of my CCLabelBMFont object, the position is updated. So if I want to show updating lapsed time, then time is changing position on each update.
How can I maintain position of CCLabelBMFont while changing string value?

the position of the node should remain the same till you change it somehow. I suppose you mean that text position is related to its length. Try to set anchor point of the label. If anchor point set to 0,0 (left bottom corner) then when text length will grow its position will remain the same.
P.S. you can use different anchor point values to achieve alignment that you need

Related

iOS Core Plot Get visible labels X axis

I am using Core Plot and I am really still new to it. I have searched but could not find the answer. I have allowsUserInteraction enabled. I have implemented zoom in/out with that. I want to be able to get first and last visible label on X axis every time when user has zoomed in/out. I know that there is willChangePlotRangeTo I have called there expandRangeByFactor method on my CPTMutablePlotRange. I want to be able to get every time text from first and last visible label on X axis. Is there any delegate method that I have missed?
Whenever you need to find out what the current axis labels are, call -layoutIfNeeded on the axis to make sure the labels are up-to-date and get the set of labels from the axisLabels property. Since it's a set, the collection is unordered. You'll have to search the whole set to find the first and last ones. Each label has a tickLocation that is the location along the axis and a contentLayer that is the label displayed at the location. The automatic axis labels are always CPTTextLayer objects, so you can extract the text property from there.

Coreplot: Axis Labels Fixed Location

I'm trying to customize a Coreplot graph in many ways I can and the next thing I would like to do is place the X Axis Labels (one that is custom as well) at the bottom of the graph, independent of the X axis' position (whether it's scrolled up or down).
To make it clear, it is similar to giving the labels an offset value of something like 50.0. But offset is not the property I'm looking for since it fixes the labels location relative to the X axis.
Any way this can be done? Or do I have to skip the axisLabels property and place and layer or something manually at the bottom of the graph?
EDIT: Alright, I managed to place an axis on the bottom with CPTConstraints. But it's not on the bottommost. If a plot point is on those levels, the plot line overlaps the labels. I tired padding of the graph but of course, it moves the whole graph, hence the issue persists.
Thanks in advance
Make a second x-axis. Have the first one draw the axis line, tick marks, etc., as normal but no labels. Label the second one and set all of the line style properties to nil so it doesn't draw any of the lines.
Turns out that aside from the graph, the plotAreaFrame property of the CPTGrpah also has paddings. If you give more paddings to plotAreaFrame than that of the graph, the plot will be drawn in a smaller frame and the rest of the graph area will be for you to add what you want (i.e., a second Axis).
Big thanks to #Eric, for trying to answer Every single CorePlot question as soon as possible.
CorePlot does have a lot of customisation than I thought.

How can I draw a point at my ImagevView's anchorpoint?

I am trying to achieve some effect using imageViews and I need to set the anchorpoint correctly. It is very hard without it being visible.
How would you go about showing it up on the imageview ?
The anchor point is a property specified on the layer (you will need QuartCore to access it). It is specified in the unit coordinate space of the device (both x and y goes from 0 to 1 within the bounds of the layer. You can know the coordinate of the actor point by multiplying the x value with the width and the y value with the height. To draw a point at that location you could just add a new, small layer (bounds 4x4 and corner radius 4 (to get a circle))
Be aware that changing the anchor point will change where the layer (and the view) appears on screen as the frame is calculated relative to the anchor point. To have the frame appear in the same place after the anchor point has been set you could re-set the frame (this will update the layers position so that the frame is what you expect it to be)

How to position the Highcharts.StockChart's rangeSelector zoom on the right?

My question is very simple:
How to position the Highcharts.StockChart's rangeSelector zoom on the right?
Its default is left. I couldn't find any documentation regarding it. Only how to position the input text elements of the inputBoxStyle
You can change only the input and labels position.
If you want to change the buttons position you have to change the source code.

Problem with a vertical UISlider with custom images

So i have a custom UISlider. It's vertical (i did it with the +270° technic). I have 3 images, respectively for the minimum value, maximum value and for the thumb. Everything seems good but i have problems with the extrema values, as you can observe on the screen capture (even though it's a little dark).
The slider on the left is perfect ! Both end of the sliders show the images perfectly and the cursor (thumb) is perfectly cutting the slider in 2.
The other two sliders on the right shows a similar issue. We can see that, when in extrema value, the cursor is not well located (there shouldn't be any part of the image below or above the middle of the cursor !) Oo
More to that, let's look at the right slider (with minimum value). We can see that image has been cut on the bottom ! Indeed it should be close. It's the same thing for the maximum value, the image looks like it's been cut.
I looked at the bounds of the slider view by touching it at both ends and looking at its coordinates. The slider was defined with a height of 300 but i can perform touches at coordinate 307, or -6 !!! I don't really understand why..
For more information, coordinates form 300 to 310 represents the maximum value i defined and negative coordinates (from 0 to -10) represents the minimum value.
-> So We can notice there's a difference of 10 at both ends.
Please help ! :s

Resources