I really like this UI element in Apple's Measure app. How would I go about drawing something that looks like that?
It shouldn't be an image because I would like it to scale according to the text intrinsic size.
3 options
1- UIPopoverPresentationController
2- UIMenuController
3- Usual UIView and the arrow is drawn by QuadCurve
Related
In my iOS app I would like to make it so that emoji fall from the top of the self.view.
How can I accomplish this? Here is an example of what I mean.
To accomplish a rain of emoji style effect, you can use CAEmitterLayer
You can configure your position, birthrate, size etc. of your emitterLayer and add it to your view.layer .
Wondering if the above can be created using UISlider? If not, what other ways can this be accomplished?
You can set components of a UISlider, such as the currentThumbImage ( see: "Appearance of Sliders"1).
However, it is almost certainly easier to just re-implement a slider for this much customization. Simply use background UIImageView with the scale image, and then add a separate UIView (or UIImageView) for the arrow. Finally, attach a UIPanGestureRecognizer to the arrow view to allow a user translate the view vertically.
You can change a lot in the appearance of a UISlider like setting the thumb to a red arrow. You can also replace the background image with the inches ruler and with different rulers for the different device types and display sizes.
The one thing that I don't see is that you turn the slider to work vertically. I know them only working left to right.
If I'm right, your only chance is to have a ruler as background image and a view that contains the arrow and a label with the actual value. That whole view can be pawned and tapped using Gesture Listener.
How can I draw a little triangle above the selected item in a UISegmentedControl? Does anyone know an open-source than extends it?
(if not - pointers of how to do it)
Design should look like (this is in the bottom of the screen)
I don't believe there's a native way to do that. You can either find a library that allows for it, but you can do it yourself fairly easily, which I recommend.
I can think of a few out of the box ways to approach it, here at the two I think worth mentioning off the bat:
1) Use UISegmentedControl with images. Make the segmented controller have a height that includes the triangle, and have an image for selected and normal states that shows what you want. The Normal states would have a rectangle of transparency on top, as wide as the entire image and as tall as the triangle. The selected image would include the triangle. Both images should end up the same width and height.
2) Subclass UISegmentedControl and do some custom drawing in drawRect:. You could draw the triangle outside (above) the bounds of the segmented controller, make sure to set the segmented controller's clipToBounds property to NO, as well as its layer's masksToBounds property.
If you'd like more help, or some other suggestions, just ask.
I'd like to change the corner radius and arrow shape (more pointed that curved like in iOS 7). Is this possible?
So the way I solved this was to create a custom popover image using GIKPopoverBackgroundView. It's a really nice drop in class that takes care of the image stretching etc for you. I just edited the supplied PSD and went from there.
I am trying to develop paint type App for iPhone/iPad. I have done 70% but one functionality is taking time to complete it. I have added To Fill Selected Area with Selected Color functionality inside it. I did it but it is taking to much time or working too slow. Due to this functionality, whole App become freeze.
Structure of Drawing View :-
UIView(Parent View)
-UIImageView(SubView1)-To keep image as a background
-UIImageView(SubView2)-To draw color or draw line
In above structure, Parent view is work as a Canvas View and Subview1 is lowerview and Subview2 is upperview.
My approach :-
1)finding currnet point.
2)getting pixtel color.
3)get screen shot for whole screen.
4)get array for those pixtel who have a same pixtel color as select pixtel in current screen shot
5)now we use 4Q pixtel fill color for identifying pixtel who is connected with selected pixtel and making array for all those pixtel.
6)After getting the final array for the pixtel, we draw a pixtel with selected color.
Any one help.
I need a another implementation for Flood fill with a more smooth way functionality.
Pls provide me a Code sample.
Thanks in Advance.
Use a stack based flood fill: http://www.drowningintechnicaldebt.com/ShawnWeisfeld/archive/2006/12/04/stack-based-flood-fill-algorithm.aspx
I found this and it worked a treat for me!
https://github.com/Chintan-Dave/UIImageScanlineFloodfill
Very easy to implement too.