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 .
Related
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
NOTE: I can't use UIView's maskView method because that changes the UITextView into a single view. My UITextViews are movable via pan, rotate and pinch gestures and maskView doesn't allow that.
Please look at these 2 pictures to understand what I am trying to achieve:
The first picture is what I already have. The background image of the tiger is a UIImageView. On top, I have 2 UITextViews "Love" and "Yolo". There can be more than 2 UITextViews too. I am trying to convert the first to look like the second one. Basically I want the UITextViews to show transparent see-through text. Everything which is not UITextView gets grey color.
Now note the 3rd image where the 2 UITextViews overlap each other. When overlapping, I want it both the UITextViews to be see-through like this image:
How can I achieve this effect? I am looking for guidelines on how this can be achieved.
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.
I'm struggling with a problem:
I did create an UIView with subviews inside to make my own UIToolBar.
I added a UIView which acts like a delimiter line on top of it.
Then I decided to make one of the subviews rounded on center. But I need to find a way to "curve" the delimiter UIView.
Actually I have:
I want:
Is there anyway to fullfill my goal programmaticaly in swift ?
I thought about importing an UIImageView and make the images according to the differents iPhone size but is there any other solution ?
I solved a similar problem by sandwiching a dark gray circle image behind the toolbar, and a light gray circle image in front of the toolbar but behind the button. It's a hack but it works perfectly if you match the colors, and it's easier than doing path drawing.
I need to draw text with a background. I need the background to be not just a square but to wrap the lines.
So using the background color of a UILabel is no good for me.
I suppose I need to draw it, but I dont know how..
Just to be clear, I don't want a square background like this:
I want background like this:
p.s.
I really don't want to use more then one label to get this effect...
I also need it to support ios 4.3 so I can't use new things like NSAttributedString.
You can't do it easily with UILabel element on iOS 4. For example you can override UILabel class and play with calculating text width and then setting black views to the background, which is not an easy job.
I suggest you to use UIWebView instead. You can simply use HTML and CSS rules.