uiimageview

How to add the text in UIImageView in Swift?

自古美人都是妖i 提交于 2019-12-08 14:20:26
问题 I have some issues for editing UIImageView. User can enter the text in imageview then it processes to save it and after that user can view this image with the text . How can I do this? 回答1: I tried and got the solution for adding the text inside the UIImageview.Below is the coding import UIKit class ViewController: UIViewController,UINavigationControllerDelegate, UIImagePickerControllerDelegate,UIGestureRecognizerDelegate{ @IBOutlet var imageViewText: UIImageView! var

How to create a UIImage from bytes [duplicate]

十年热恋 提交于 2019-12-08 14:15:00
问题 This question already has answers here : How do I create an image from a Base64-encoded string in Swift? [duplicate] (2 answers) Closed last year . I've a String with byte code of a Image, I want create a UIImage from it. My data is like below: /9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0a HBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIy MjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCABAAEADASIA AhEBAxEB

After applying while condition code starts acting differently

那年仲夏 提交于 2019-12-08 13:14:27
问题 I'm developing a game in which I want my image to reduce in size gradually. I'm reducing the frame size gradually in my code when it works fine. [I've already used CGAffineTransform and it doesn't suit my requirement.] -(void)function { ravanImage1.frame=CGRectMake(150,((ravanImage1.frame.origin.y)-5),q,z); if(ravanImage1.center.y>=300&&ravanImage1.center.y<=370) { q=60; z=60; ravanImage1.frame=CGRectMake(150,((ravanImage1.frame.origin.y)-5),q,z); } if(ravanImage1.center.y>=230&&ravanImage1

UIImage which follow touches

回眸只為那壹抹淺笑 提交于 2019-12-08 12:50:04
问题 I'm trying to draw a ruller which follow the touches on the screen. On the first touch, I set the first point and on all the other, the ruller follow the finger on ther screen resizing and rotating around the first point depending on where the finger is. I tried to do this : - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch = [touches anyObject]; CGPoint p = [touch locationInView:self.view]; self.regleFirstPoint = p; UIImageView* img = [[UIImageView alloc]

Tap gesture on multiple imageview inside scrollview not firing event , only first imageview tap gesture working?

混江龙づ霸主 提交于 2019-12-08 12:41:40
问题 Scenario is I have imageview which I have added inside a scrollview and then tapgesture added on each imageview but only first one imageview firing event . Have tried following : 1. Created Extension of imageview extension UIImageView { public func openMenu() { let tapGestureRecognizer = UITapGestureRecognizer(target:self, action:Selector("handleTapGesture:")) //mImg.addGestureRecognizer() self.addGestureRecognizer(tapGestureRecognizer) print("open") } } 2. Added tap gesture in the loop (the

Prevent vertical UIStackView from stretching a subview?

浪子不回头ぞ 提交于 2019-12-08 11:58:20
问题 I have a UITableViewCell with a vertical UIStackView that currently has .alignment = fill and distribution = fill. Inside the stack view, I have a UILabel and a UIImageView. The label should be left aligned and stretch across the width of the stackview (and it does). The image view has a content mode of aspect fit and should be centered in the middle of the stackview. I thought this was working as I wanted it to until I set a background color on the UIImageView and then realized that while

assign a CAlayer to a UIImageView to be able to do all you can do with a UIImageView

情到浓时终转凉″ 提交于 2019-12-08 10:45:24
问题 Hi every one there is a link :link and there is a sample code in it where the author use a CALayer with CAShapeLayer.What I would like is to use this CALayer like it was a uiimageView (maybe assign to a uiimageview) to be able to move it etc... 回答1: You cannot change the layer type of an existing UIView (meaning: you also can't change the layer of an UIImageView ), but drawing to a layer is pretty easy: you need to assign a delegate to your CALayer , and that delegate needs to implement

Setting a UIimage view equal to another UIimage View

∥☆過路亽.° 提交于 2019-12-08 10:38:06
问题 I am making a little animation type of app for a project. I have a space to draw images on an imageView. Then when you click the new page button I need the image in that imageview to move into another imageview I have on the timeline. Hopefully you understand my problem if not let me know what other information you need. 回答1: hai Check This code This will allow you to draw any image and then you can access your image using method getimage in nsdata format. and then you can convert it into

How to populate a UIScrollView with UIImageView's lines up in a row

筅森魡賤 提交于 2019-12-08 10:17:55
问题 I need some code on how to make a UIScrollView that contains UIImageViews lined up like the iPhone photo's app that comes with the phone. 回答1: This is a frequently asked question around here. Several questions that might have answers on the various aspects of doing this are UIScrollView image/photo viewer with paging enabled and zooming Photos app-like gap between pages in UIScrollView with pagingEnabled Flicking through pages / photos with UIImageViews (similar to Facebook photos app or home

iOS - Invert a UIImage with button

给你一囗甜甜゛ 提交于 2019-12-08 09:52:50
问题 I have a simple application where I can take an photo or choose and existing photo on the camera roll and then display the image in a UIImageView. I want to have a button that you can press and invert the picked image and then display that in the camera roll. My question is, how do invert the colors of a UIImage and then use the new inverted one to display in the ImageView? I have seen other posts related to this but none explain how implement the code. I'm fairly new to xcode and would