AVAudioPlayer controls handle - ios

Hi all. How can I make a smaller progress circle?
Thanks

Is that an UISlider? If so, you can customize the slider by adding a set of images for different states.
setMinimumTrackImage:forState:
setMaximumTrackImage:forState:
setThumbImage:forState:
The one you're looking for is setThumbImage:forState:, which as you can read, is an UIImage. Default thumb size, I think, is between 23x23 and 25x25.
If you need more help on how to customize the UISlider, you can take a look at this tutorial (old but still works), this answer and of course read the UISlider documentation

Related

Swift - ios - creating ballon buttons

I want to create a set of buttons that will look like this:
(The selected buttons are those with a different background)
Any ideas for a simple implementation?
Are there any known open source implementations for this?
Thanks!
Following is the library which may be use to solve your problem,
For different appearance you need to give the conditional code for that but with out that your problem may solve with this library or code.
You can download the sample code of RRTagController project here.
For rounded corners use UIButton.layer.cornerRadius. if you set corner radius to half of the box you will get circle. For the border color use layer.borderColor = UIColor.redColor().CGColor.
For the background color of the button you can keep track with selected state of the button. Here is an example of using selected state: UIButton state selected
Next thing you could do is to keep data about selected ones, since the best way to do something like this would be UITableView - seems like every row of buttons have same height, and if you want to send that somewhere you can keep track about what items are selected.
I think the best way is to use UICollectionView.

How do I place a button inside of an image?

Is it possible to place a UIButton inside of a UIImage with the Apple Watch? It seems that I can only place objects beside each other rather then on top of them as I can with iOS
As far as I know you can not do that.
But what you can do is to create a button and set it's backgroundImage.
Hope that helps :)
Short answer, you can't really place items on top of each other with WatchKit, but you can use the background image of a group to do it:
Can I position interface elements on top of each other?
No, interface elements can’t be positioned on top of each other natively. However, there are workarounds. For example, you can use a WKInterfaceGroup and set its background image to something that represents the control you want to overlay. Inside the group you can then add the necessary labels, buttons and so on.
This comes from Ray Wenderlich's WatchKit FAQ, which is a pretty reliable source. I'll link to fully official sources if I find it.
The solution is, as stated above, to use a WKInterfaceGroup and set its background image to something that represents the control you want to overlay. Inside the group you can then add the necessary labels, buttons and so on.
Note that this question also is about laying elements on top of images.

How to achieve smooth transition when image of button changes between states?

In iOS, we use the UIView animate block for tyo make chnages to properties of any control and that happens with a smooth transition.
Is it possible to achieve that when images of different state changes for UIButtons ?
What I can think of as of now is to manually change the image or state in animation block.
Is there a simpler way at the interface builder level or may be at code level so that I dont have to do this ?
Check out this Stackoverflow answer
link
I would subclass UIButton like in this answer so you only need to write the code once.

Designing a circular "selector" control

I'm developing an app that calculates poker odds, and now I'm facing some problems with the card selector.
This is a mockup of what I want.
I've found two ways to accomplish this. The first one is to use an entire UIImageView and detect touches, calculate where the touch has been generated, and set the corresponding value.
The second one is to use a lot of UIButtons, but in this case I get problems with the shape of the buttons.
Of course I can use a regular UIPickerView and so on but I think that the one I've designed is better.
if you have a UIButton with a background image that is shaped irregular. then that is the only point that the button can be pressed.
Change the type to custom and put your slices into buttons.
This has been my experience anyhow.
My buttons have to have a .01 alpha background to increase their pad size and people can push the button.
Hope that helps :)
After googled a little i've found https://github.com/ole/OBShapedButton .
it does anything what i need

Scrolling items on screen [iOS cocos2d]

OK so in my game I need the users to scroll between items, just like you scroll a web page in Safari. Is there any way to do that? If not, maybe scrolling them to the side, like you do in the spriboard? Thanks.
I am not really sure I have understood what you would like to do, but there is a cocos2d extension that seems appropriate to it: CCScrollLayer.
CCLayer subclass that lets you pass-in an array of layers and it will then create a smooth scroller. Complete with the “snapping” effect.
If you are looking for a generic scrolling within your view, I suggest this tutorial or this topic rom cocos2d list.
EDIT:
I have never done it, but I think it should be possible to scale the CCScrollLayer to the size you need.
Otherwise, you might change the contentSize of the layer, or even put the CCScrollLayer into a clipping node.
Anyway, I think that it is much easier to start from this and find a way to adapt it to your specific requirements than start from scratch.

Resources