uiimageview

How do I make a UIImage fade in and fade out as I scroll?

我的梦境 提交于 2019-12-11 05:06:00
问题 I have a stretchy header that I made following this tutorial http://blog.matthewcheok.com/design-teardown-stretchy-headers/. Anyway it's working perfectly but I'm having trouble making a UIView on top of it fade out as the view stretched and returning to original alpha as the view is returned to normal. Best I could come up with is this: override func scrollViewDidScroll(scrollView: UIScrollView) { updateHeaderView() var offset = scrollView.contentOffset.y if offset < -170 {

How can I display a splash screen for a longer period of time than the default time on an iPad?

亡梦爱人 提交于 2019-12-11 05:05:54
问题 I have try so many way in display the splash screen for a longer period of time but i did't get perfect solution,please help me out. 回答1: in AppDelegate.m file just define splashView as a UIImageView and then in didFinishLaunchingWithOptions method write this type of code... - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease]; // Override point

Merge two imageViews into one and save iOS swift

萝らか妹 提交于 2019-12-11 04:37:43
问题 I have 2 imageViews like below. (ScrollView has subview of imageView) i want to take the image of each one and merged to one. i tried using taking screenshot and crop. but when it comes to different iphone screensizes and resolutions it doesn't work well. can any one guide me how to do this? 回答1: Why not just add them both to one UIView? It is also possible to add a subview to your image view and extend the frame. [secondImageView setFrame:CGRectMake(x,y + newImageHeight,width,height)]; [self

How to detect when UIImageView flip vertically

别来无恙 提交于 2019-12-11 04:31:53
问题 I check from UIImageView's scaleY but it doesn't work (see the code below). CGAffineTransform t = [myImageView transform]; // Keep matrix value of UIImageView float scaleY1 = sqrt(t.b * t.b + t.d * t.d); // 1.0000 CGAffineTransform t2 = CGAffineTransformScale(t, 1, -1.0); // flip UIImageView vertically float scaleY2 = sqrt(t2.b * t2.b + t2.d * t2.d); // 1.0000 [myImageView setTransform:t2]; NSLog(@"1: %f, 2: %f", scaleY1, scaleY2); // 1: 1.0000, 2: 1.0000 From above, you can see that before

Any alternative to get Image name that is currently set to UIImageView?

六月ゝ 毕业季﹏ 提交于 2019-12-11 04:21:26
问题 I am using a UIImageView and about 5 images that is changing time to time with the help of timer. Can we get currently set image name in UIImage.I google it and found a that by inserting image names to array and by setting tag to imageView we can get image name by its tag but in my case there is only one imageView and images are 5.My code is given below:-- [_imgView setImage:[UIImage imageNamed:@"tops.png"]]; imgArray=[[NSArray alloc] initWithObjects:@"tops.png",@"position_conv.png",@"stocks

ContentMode changes in uiimageview after draw

拟墨画扇 提交于 2019-12-11 04:19:53
问题 I have been following Ray Wenderlics's tutorial on how to create a basic draw app. Ive got it working perfectly except for when I draw the content mode changes on the uiimageview. I've set it to aspectFill in storyboard and applied an image I think the problem is in my touches ended method override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?) { if !swiped { // draw a single point drawLineFrom(fromPoint: lastPoint, toPoint: lastPoint) } // Merge tempImageView into

NSUserDefaults - Saving UIImageView Position

不打扰是莪最后的温柔 提交于 2019-12-11 04:18:34
问题 In my application, I have a UIImageView and a UIButton. The UIImageView has a UIPanGestureRecognizer, and can be dragged around the screen. I have written: int defaultBallLocation = ball.center; in my - (IBAction)saveButton and Xcode is saying "Cannot associate CGPoint with int". So, how can I save the ball (UIImageView) position on the screen by pressing "save", then load the saved position by pressing "load" through NSUserDefaults? I have worked with NSUserDefaults before, but only with a

Attach GestureRecogniser to multiple imageviews

好久不见. 提交于 2019-12-11 03:49:49
问题 Something strange I encountered today while attaching same gesture recogniser to multiple image views. It gets attached to only the last one, in other words, it can be attached to only one view! I had to create multiple gesture recognisers to meet my requirements. Following is what I have done. Am I doing correct? Is that's the only way to attach recognisers to the multiple imageviews? Please note that I don't want to use UITableView or UIVIew and put all imageviews in it and attach gesture

Best practice for animated image in iOS - UIImage or UIImageView?

两盒软妹~` 提交于 2019-12-11 03:43:11
问题 Sorry if the question is a bit subjective, but I couldn't find anything about the topic. The question is simple: Which one of the following alternatives are "best", (i.e. best performance). I want to show the image in an UIImageView regardless of the chosen solution. self.imageView.image = [UIImage animatedImageNamed:@"imagename-" duration:2.0f]; or self.imageView.animationImages = listOfMyImageNames; self.imageView.animationRepeatCount = 0; self.imageView.animationDuration = 2; [self

UIImageView's image takes up to 10 seconds to load

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-11 03:36:21
问题 I have a problem with my Swift code. I want to load a local image into an ImageView. This works fine. But when I simulate the app, you can only see the image after 10-15 seconds and I can't find the problem. Here the code for the image: let image = UIImage(named: "simple_weather_icon_01"); weatherIcon.image = image; self.activityIndicatorView.stopAnimating() Edit: override func viewDidLoad() { super.viewDidLoad() get_data_from_url("myURL") } func get_data_from_url(url:String) { let url =