Search Results

Search found 530 results on 22 pages for 'uiimageview'.

Page 10/22 | < Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • Adding picture in pickerview

    - by iSharreth
    UIImageView *one = [[UIImageView alloc]initWithImage:[[UIImage alloc] initWithContentsOfFile:[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"ball1.png"]]] ; UIImageView *two = [[UIImageView alloc]initWithImage:[[UIImage alloc] initWithContentsOfFile:[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"ball2.png"]]] ; UIImageView *three = [[UIImageView alloc]initWithImage:[[UIImage alloc] initWithContentsOfFile:[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"ball3.png"]]] ; arrayBalls = [[NSArray alloc]initWithObjects:one,two,three,nil]; I used the above code for displaying image in the pickerview. But the application is crashing when executing this code. Anyone please help.

    Read the article

  • How do I get a thumbnail or saveable path from UIImagePickerController to use for a UIImageView?

    - by viperacr99
    Could somebody please explain or show some sample code of how I can use get a thumbnail to be put into a UIImageView after the user selects a photo with UIImagePickerController? Let's say I want to set a thumbnail as the image of a table view cell. When the user presses the cell, the image picker is shown and the user selects an image that is already on their device. I also want to save the path to that thumbnail so that the next time the view is displayed, the proper thumbnail can be shown. I am able to display an image picker and my delegate get's the chosen image correctly, but I want the path to the thumbnail, and I want to load the thumbnail using that path (i.e. I want to save the path). I've searched for hours today and haven't figured this out. Perhaps I'm not understanding ALAsset, or maybe it is something else, but I can't find any examples that are helping me. I have never used the image picker or ALAsset before now, so I'm completely new at this.

    Read the article

  • how to get access subview of UIView?

    - by RAGOpoR
    according to this code if i want to access imageView1 and imageView2 how can i access to it? please show me some example example cell.accessoryView.subviews ? UIImageView *imageView1 = [[[UIImageView alloc] init] autorelease]; UIImageView *imageView2 = [[[UIImageView alloc] init] autorelease]; imageView2.alpha = 0; [cell.accessoryView addSubview:imageView1]; [cell.accessoryView addSubview:imageView2];

    Read the article

  • How no make a button show UINavigationBar only in 3 of 5 tabs in UITabBar?

    - by Mike Rychev
    I have an app, where there's a UITabBar with 5 tabs. When user shakes the device, I want the UINavigationBar to push an UIImageView. When I show the UIImageView, I need to hide both tab and nav bars. After that, when user taps the UIImageView, the NavBar appears again and user can go to the UIImageView's parent view. I make the Nav Bar appear like this: [[self navigationController] setNavigationBarHidden:NO animated:YES]; But in two tabs I have to make the Nav Bar appear, so user can switch to UIImageView's parentView and then, when the parent view appears, hide the nav bar. How can I do it?

    Read the article

  • Using UITouch inside a UIScrollView

    - by Chris
    Hi all, Just toying with the SDK and I was wondering if possible a UITouch event can work inside a UIScrollView. I have setup a UIScrollView which handles a large UIView, inside the UIView is a UIImageView, I've managed to get the UITouch to drag the UIImageView outside of the UIScrollView but inside it's not registering the event. I suppose what I was trying to accomplish was dragging the UIImageView around the large UIView whilst the UIScrollView moves along the image if the user drags it beyond the POS of when the UIView when the UIImageView began it's dragging, if that makes sense? Many thanks

    Read the article

  • UIImagePickerController weirdness ...

    - by John Michael Zorko
    Hello, all ... UIImagePickerController is easy to use, but i'm all of a sudden finding it exasperating when I didn't find it so before. What's happening is that sometimes the imagePickerController:didFinishPickingImage:editingInfo delegate method does not seem to work -- the image will not show in the UIImageView even after the assignment was made. Sometimes it will, sometimes not, and furthermore, every single bit of example code i've tried (from the web, from the "Beginning iPhone 3 Development" book, etc.) exhibits the same problem. I'm at a loss as to why, and the problem happens on both my iPhone 3G as well as my 3GS, so I doubt that it's a hardware issue. These devices are running OS 3.1.2. The view controller is loaded from a xib file that contains one button and the UIImageView. I'd really like someone to tell me what stupid thing i'm obviously doing wrong :-) Here is the code -- i've tried to make the smallest app I could that exhibits the problem: #import <UIKit/UIKit.h> #import <Foundation/Foundation.h> @interface imagepickerViewController : UIViewController <UINavigationControllerDelegate, UIImagePickerControllerDelegate> { IBOutlet UIButton *button; IBOutlet UIImageView *imageView; } @property (nonatomic, retain) UIImageView *imageView; - (IBAction)takepic; - (void)usePic:(UIImage *)pic; @end #import "imagepickerViewController.h" @implementation imagepickerViewController @synthesize imageView; - (IBAction)takepic { if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) { UIImagePickerController *picker = [[UIImagePickerController alloc] init]; picker.sourceType = UIImagePickerControllerSourceTypeCamera; picker.delegate = self; [self presentModalViewController:picker animated:YES]; [picker release]; } } - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)image editingInfo:(NSDictionary *)info { [self usePic:image]; [picker dismissModalViewControllerAnimated:YES]; // after this method returns, the UIImageView should show the image -- yet very often it does not ... } - (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker { [picker dismissModalViewControllerAnimated:YES]; } - (void)usePic:(UIImage *)picture { imageView.image = picture; } @end

    Read the article

  • Optimization headers for UITableView?

    - by Pask
    I have an optimization problem for the headers of a table with plain style. If I use the standard view for the table (the classic gray with titles set by titleForHeaderInSection:) everything is ok and the scrolling is smooth and immediate. When, instead, use this code to set my personal view: - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { return [self headerPerTitolo:[titoliSezioni objectAtIndex:section]]; } - (UIImageView *)headerPerTitolo:(NSString *)titolo { UIImageView *headerView = [[[UIImageView alloc] initWithFrame:CGRectMake(10.0, 0.0, 320.0, 44.0)] autorelease]; headerView.image = [UIImage imageNamed:kNomeImmagineHeader]; headerView.alpha = kAlphaSezioniTablePlain; UILabel * headerLabel = [[[UILabel alloc] initWithFrame:CGRectZero] autorelease]; headerLabel.backgroundColor = [UIColor clearColor]; headerLabel.opaque = NO; headerLabel.textColor = [UIColor whiteColor]; headerLabel.font = [UIFont boldSystemFontOfSize:16]; headerLabel.frame = CGRectMake(10.0,-11.0, 320.0, 44.0); headerLabel.textAlignment = UITextAlignmentLeft; headerLabel.text = titolo; [headerView addSubview:headerLabel]; return headerView; } scrolling is jerky and not immediate (sliding the finger on the screen does not match an immediate shift of the table). I do not know what caused this problem, maybe the fact that every time the method viewForHeaderInSection: is called, the code runs to create a new UIImageView. I tried many ways to solve the problem, such as creating an array of all the necessary view: apart from more time spent loading at startup, there is a continuing problem of low reactivity of the table. 've Attempted by reducing the size of UIImageView positioned from about 66 KB to 4 KB: not only has a deterioration in quality of colors (which distorts a bit 'original graphics), but ... the problem persists! Perhaps you have suggestions about it, or know me obscure techniques that enable me to optimize this aspect of my application ... I apologize for my English, I used Google for translation.

    Read the article

  • grabbing layer contents in a class

    - by Mike
    I have a custom UIImageView class that creates thumbnails (UIImageView) and each thumbnail has a label. The label is created by another class. The label class creates a UIImageView and a UITextView on top of it. This is the init object class' init method: - (id)initWithFrame:(CGRect)frame { if ([super initWithFrame:frame] == nil) { return nil; } CGRect myFrame = CGRectMake(0, 0, 100, 100); myLabel = [[myLabelClass alloc] initWithFrame: myFrame]; //myLabelClass is a UIImageView based class [myLabel setCenter:CGPointMake(50, 50)]; [self addSubview: myLabel]; return self; } So, I have this MAIN VIEW CONTROLLER | |___ UIImageView WITH LABEL | |____ label background (UIView) |____ UITEXTVIEW (text) Now I want to write the contents of all these 3 components to a quartz context. I need to write using drawInRect, because I need to write the full object to a precise location. I expected object.layer.contents to be the image equivalent to these 3 "layers" flattened, in other words, the object's image, the label background and the label text, as it would if I created these 3 objects in Photoshop and flatten the composition. I also expect object.myLabel.layer.contents to contains the rendered contents of the UITextView over the label background. The problem is that when I use UIImage *myImage = [UIImage imageWithCGImage:objecto.myLabel.layer.contents]; [myImage drawInRect:CGRectMake(0, 0, 100, 100)]; I get nothing. How can I obtain a "flattened" image resultant to the full object (including its subviews)? thanks

    Read the article

  • iPhone memory management

    - by Prazi
    I am newbie to iPhone programming. I am not using Interface Builder in my programming. I have some doubt about memory management, @property topics in iPhone. Consider the following code @interface LoadFlag : UIViewController { UIImage *flag; UIImageView *preview; } @property (nonatomic, retain) UIImageView *preview; @property (nonatomic, retain) UIImage *flag; @implementation @synthesize preview; @synthesize flag; - (void)viewDidLoad { flag = [UIImage imageNamed:@"myImage.png"]]; NSLog(@"Preview: %d\n",[preview retainCount]); //Count: 0 but shouldn't it be 1 as I am retaining it in @property in interface file preview=[[UIImageView alloc]init]; NSLog(@"Count: %d\n",[preview retainCount]); //Count: 1 preview.frame=CGRectMake(0.0f, 0.0f, 100.0f, 100.0f); preview.image = flag; [self.view addSubview:preview]; NSLog(@"Count: %d\n",[preview retainCount]); //Count: 2 [preview release]; NSLog(@"Count: %d\n",[preview retainCount]); //Count: 1 } When & Why(what is the need) do I have to set @property with retain (in above case for UIImage & UIImageView) ? I saw this statement in many sample programs but didn't understood the need of it. When I declare @property (nonatomic, retain) UIImageView *preview; statement the retain Count is 0. Why doesn't it increase by 1 inspite of retaining it in @property. Also when I declare [self.view addSubview:preview]; then retain Count increments by 1 again. In this case does the "Autorelease pool" releases for us later or we have to take care of releasing it. I am not sure but I think that the Autorelease should handle it as we didn't explicitly retained it so why should we worry of releasing it. Now, after the [preview release]; statement my count is 1. Now I don't need UIImageView anymore in my program so when and where should I release it so that the count becomes 0 and the memory gets deallocated. Again, I am not sure but I think that the Autorelease should handle it as we didn't explicitly retained it so why should we worry of releasing it. What will happen if I release it in -(void) dealloc method In the statement - flag = [UIImage imageNamed:@"myImage.png"]]; I haven't allocated any memory to flag but how can I still use it in my program. In this case if I do not allocate memory then who allocates & deallocates memory to it or is the "flag" just a reference pointing to - [UIImage imageNamed:@"myImage.png"]];. If it is a reference only then do i need to release it. Thanks in advance.

    Read the article

  • how to set imageview in webview

    - by mohsinpathan
    I am creating runtime images. i want to set that image in to web view. Please give me a hint or document.My source code is given below CGRect pdfSize = GetPdfSize(UIGraphicsGetCurrentContext(), initialPage, [filePath UTF8String],myTable,mainString); //UIImageView *imgV=[[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 598,768)]; UIImageView *imgV=[[UIImageView alloc]initWithFrame:CGRectMake(0, 0, pdfSize.size.width,pdfSize.size.height)]; UIGraphicsBeginImageContext(CGSizeMake(pdfSize.size.width,pdfSize.size.height)); MyDisplayPDFPage(UIGraphicsGetCurrentContext(), initialPage, [filePath UTF8String],myTable,mainString); imgV.image=UIGraphicsGetImageFromCurrentImageContext(); imgV.image=[imgV.image rotate:UIImageOrientationDownMirrored];

    Read the article

  • How do I stack images to simulate depth using Core Animation?

    - by Jeffrey Berthiaume
    I have a series of UIImages with which I need to simulate depth. I can't use scaling because I need to be able to rotate the parent view, and the images should look like they're stacked visibly in front of each other, not on the same plane. I made a new ViewController-based project and put this in the viewDidLoad (as well as attached three 120x120 pixel images named 1.png, 2.png, and 3.png): - (void)viewDidLoad { // display image 3 UIImageView *three = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"3.png"]]; three.center = CGPointMake(160 + 60, 240 - 60); [self.view addSubview:three]; // rotate image 3 around the z axis // THIS IS INCORRECT CATransform3D theTransform = three.layer.transform; theTransform.m34 = 1.0 / -1000; three.layer.transform = theTransform; // display image 2 UIImageView *two = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"2.png"]]; two.center = CGPointMake(160, 240); [self.view addSubview:two]; // display image 1 UIImageView *one = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"1.png"]]; one.center = CGPointMake(160 - 60, 240 + 60); [self.view addSubview:one]; // rotate image 3 around the z axis // THIS IS INCORRECT theTransform = one.layer.transform; theTransform.m34 = 1.0 / 1000; one.layer.transform = theTransform; // release the images [one release]; [two release]; [three release]; // rotate the parent view around the y axis theTransform = self.view.layer.transform; theTransform.m14 = 1.0 / -500; self.view.layer.transform = theTransform; [super viewDidLoad]; } I have very specific reasons why I'm not using an EAGLView and why I'm not loading the images as CALayers (i.e. why I'm using UIImageViews for each one). This is just a quick demo that I can use to work out exactly what I need in my parent application. Is there some matrix way to translate these 2d images along the z-axis so they will look like what I'm trying to represent? I've gone through the other StackOverflow articles as well as the Wikipedia references, and have not found what I'm looking for -- although I might not necessarily be using the right terms for what I'm trying to do.

    Read the article

  • How to draw an CGImage with some alpha transparency?

    - by mystify
    Want to draw an UIImageView which has an CGImage, and the UIImageView has alpha 0.5f. But this CGContextDrawImage function doesnt take an transparency value. So how could I draw an image slightly transparent? To be clear: The image itself is not transparent, but I want it to be "dimmed" a little bit. Just like you would do with an UIImageView and some alpha like 0.5f :-)

    Read the article

  • how to set image in webview

    - by mohsinpathan
    I am creating runtime images. i want to set that image in to web view. Please give me a hint or document.My source code is given below CGRect pdfSize = GetPdfSize(UIGraphicsGetCurrentContext(), initialPage, [filePath UTF8String],myTable,mainString); //UIImageView *imgV=[[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 598,768)]; UIImageView *imgV=[[UIImageView alloc]initWithFrame:CGRectMake(0, 0, pdfSize.size.width,pdfSize.size.height)]; UIGraphicsBeginImageContext(CGSizeMake(pdfSize.size.width,pdfSize.size.height)); MyDisplayPDFPage(UIGraphicsGetCurrentContext(), initialPage, [filePath UTF8String],myTable,mainString); imgV.image=UIGraphicsGetImageFromCurrentImageContext(); imgV.image=[imgV.image rotate:UIImageOrientationDownMirrored];

    Read the article

  • SDWebImage : setImageWithURL fails when used to set image of a UITableViewCell

    - by Chim
    When call setImageWithURL, it fails with following, [UIImageView setImageWithURL:placeholderImage:]: unrecognized selector sent to instance 0x149a20 2011-12-14 18:11:38.060 [781:707] Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIImageView setImageWithURL:placeholderImage:]: unrecognized selector sent to instance 0x149a20' I can confirm I have included SDWebImage project and required headers correctly as I can use the SDWebImageManager successfully. Following is the code where I called the UIImageView category method setImageWithURL NSURL* url = [NSURL URLWithString:@"www.abc.com/abc.png"]; [cell.imageView setImageWithURL:url placeholderImage:[UIImage imageNamed:@"abc.png"]];

    Read the article

  • App is getting run in iOS 5.1.1 but crashed in iOS 6.1.3

    - by Jekil Patel
    I have implemented below code but app has been crashed in iPad with iOS version 6.1.3,while running perfectly in iPad with iOS version 5.1.1. when I am scrolling table view continuously it is crashed in ios version 6.1.3. what could be the issue. The implemented delegate and data source methods for the table view are as given below. #pragma mark - Table view data source -(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { // Return the number of sections. return 1; } -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { // Return the number of rows in the section. return [UserList count]; } -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { return 70; } -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; //cell = [[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; cell = nil; if (cell == nil) { // cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease]; cell = [[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; } UIImageView *imgViweback; imgViweback = [[UIImageView alloc]initWithFrame:CGRectMake(0,0,0,0)]; imgViweback.image = [UIImage imageNamed:@"1scr-Student List Tab BG.png"]; UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(5, 10, 32, 32)]; UIImageView *imageView1 = [[UIImageView alloc]initWithFrame:CGRectMake(12, 5, 50, 50)]; UILabel *lblName = [[UILabel alloc] initWithFrame:CGRectMake(110, 5, 200, 40)]; //cell.backgroundColor = [UIColor clearColor]; //cell.alpha = 0.5f; CountSelected = 0; flagQuizEnabled = NO; if ([[[checkedImages objectAtIndex:indexPath.row] valueForKey:@"checked"] isEqualToString:@"NO"]) { // cell.imageView.image = [UIImage imageNamed:@"Unchecked.png"]; //imageView.image = [UIImage imageNamed:@"Unchecked.png"]; } else { //imageView.image = [UIImage imageNamed:@"Checked.png"]; } NSString *pathTillApp=[[self getImagePath] stringByDeletingLastPathComponent]; NSLog(@"Path Till App %@",pathTillApp); NSString *makePath=[NSString stringWithFormat:@"%@%@",pathTillApp,[[UserList objectAtIndex:indexPath.row ]valueForKey:@"ImagePath"]]; NSLog(@"makepath=%@",makePath); imageView1.image = [UIImage imageWithContentsOfFile:makePath]; [cell.contentView insertSubview:imgViweback atIndex:0]; [cell.contentView insertSubview:imageView atIndex:0]; [cell.contentView insertSubview:imageView1 atIndex:2]; lblName.text =[NSString stringWithFormat:@"%@ %@",[[UserList objectAtIndex:indexPath.row] valueForKey:@"FirstName"],[[UserList objectAtIndex:indexPath.row] valueForKey:@"LastName"]]; lblName.backgroundColor = [UIColor clearColor]; lblName.font = [UIFont boldSystemFontOfSize:22.0f]; //lblName.font = [UIFont fontWithName:@"HelveticaNeue Heavy" size:22.0f]; lblName.font = [UIFont fontWithName:@"Chalkboard SE" size:22.0f]; [cell.contentView insertSubview:lblName atIndex:3]; [imgViweback release]; [imageView release]; [imageView1 release]; [lblName release]; imgViweback = nil; imageView = nil; imageView1 = nil; lblName = nil; //cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton; return cell; } #pragma mark - Table view delegate -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { NSLog(@"Values : %@", Val); }

    Read the article

  • UIView to Form Sheet flip animation rotation issue

    - by GSD
    I have this view to form sheet flip animation that works great in portrait mode but not in any other orientations. In my code, I use it with a UIView embedded in another UIView, which is in the root view. The animation will be rotated. Anyone has an idea why? - (void)presentModalViewControllerWithFlipAnimation:(UIViewController *)modalViewController fromView:(UIView *)fromView { UIWindow* window = [[UIApplication sharedApplication] windows][0]; _fromViewSnapshot = [[UIImageView alloc] initWithFrame:fromView.bounds]; UIGraphicsBeginImageContext(fromView.bounds.size); [fromView.layer renderInContext:UIGraphicsGetCurrentContext()]; [_fromViewSnapshot setImage:UIGraphicsGetImageFromCurrentImageContext()]; [_fromViewSnapshot sizeToFit]; UIGraphicsEndImageContext(); _fromViewSnapshot.autoresizesSubviews = YES; _fromViewSnapshot.frame = [fromView.superview convertRect:fromView.frame toView:window]; [window addSubview:_fromViewSnapshot]; fromView.hidden = YES; modalViewController.modalPresentationStyle = UIModalPresentationFormSheet; [self presentViewController:modalViewController animated:NO completion:nil]; UIView __weak *presentedView = modalViewController.view.superview; UIGraphicsBeginImageContext(presentedView.bounds.size); [presentedView.layer renderInContext:UIGraphicsGetCurrentContext()]; UIImage* modalSnapshot = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); UIView __weak *presentationSuperview = presentedView.superview; [presentedView removeFromSuperview]; UIImageView* presentationSnapshotView = [[UIImageView alloc] initWithImage:modalSnapshot]; presentationSnapshotView.autoresizingMask = UIViewAutoresizingNone; [_fromViewSnapshot.superview bringSubviewToFront:_fromViewSnapshot]; [UIView animateWithDuration:kFlipAnimationScaleSpeed delay:0 options:UIViewAnimationOptionCurveEaseIn|UIViewAnimationOptionBeginFromCurrentState animations: ^{ [UIView animateWithDuration:kFlipAnimationScaleSpeed delay:0 options:UIViewAnimationOptionBeginFromCurrentState animations: ^{ _fromViewSnapshot.frame = [_fromViewSnapshot.superview convertRect:presentedView.frame fromView:presentationSuperview]; } completion:nil]; } completion:^(BOOL finished) { [UIView setAnimationBeginsFromCurrentState:YES]; [UIView transitionWithView:_fromViewSnapshot duration:kFlipAnimationSpeed options:UIViewAnimationOptionCurveEaseIn|UIViewAnimationOptionTransitionFlipFromRight animations: ^{ presentationSnapshotView.frame = _fromViewSnapshot.bounds; [_fromViewSnapshot addSubview:presentationSnapshotView]; } completion:^(BOOL finished) { [presentationSuperview addSubview:presentedView]; [presentationSnapshotView removeFromSuperview]; [_fromViewSnapshot removeFromSuperview]; }]; }]; } - (void)dismissViewControllerWithFlipAnimation:(UIView*)fromView completion:(void (^)(void))completion { UIWindow* window = [[UIApplication sharedApplication] windows][0]; UIView __weak *presentedView = self.presentedViewController.view.superview; UIGraphicsBeginImageContext(presentedView.bounds.size); [presentedView.layer renderInContext:UIGraphicsGetCurrentContext()]; UIImage* modalSnapshot = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); [presentedView removeFromSuperview]; UIImageView* presentationSnapshotView = [[UIImageView alloc] initWithImage:modalSnapshot]; presentationSnapshotView.autoresizingMask = UIViewAutoresizingNone; presentationSnapshotView.frame = presentedView.frame; [window addSubview:presentationSnapshotView]; [UIView animateWithDuration:kFlipAnimationScaleSpeed delay:0 options:UIViewAnimationOptionCurveEaseIn|UIViewAnimationOptionBeginFromCurrentState animations: ^{ [UIView animateWithDuration:kFlipAnimationScaleSpeed delay:0 options:UIViewAnimationOptionBeginFromCurrentState animations: ^{ presentationSnapshotView.frame = [fromView.superview convertRect:fromView.frame toView:window]; } completion:nil]; } completion:^(BOOL finished) { [UIView setAnimationBeginsFromCurrentState:YES]; [UIView transitionWithView:presentationSnapshotView duration:kFlipAnimationSpeed options:UIViewAnimationOptionCurveEaseIn|UIViewAnimationOptionTransitionFlipFromLeft animations: ^{ _fromViewSnapshot.frame = presentationSnapshotView.bounds; [presentationSnapshotView setImage:[(UIImageView*)_fromViewSnapshot image]]; [self dismissViewControllerAnimated:NO completion:nil]; } completion:^(BOOL finished) { [presentationSnapshotView removeFromSuperview]; _fromViewSnapshot = nil; completion(); }]; }]; }

    Read the article

  • iphone presentModalViewController

    - by sandy
    Hi All, I have an app, inside that an UIViewController is attached on the UIWindow. on the view of UIViewController, i have added a button and a uiview_1 of size 100x80. this uiview_1 contains another uiview_2 as subview of same size and this uiview_2 contains a UIImageView or a UIlable at runtime (both UIImageView and UIlable are userinteraction enabled) now on the touch/click of UIImageView, i want to show a new view using presentModalViewController, the problem is the view is shown and using back button on the navigation bar i come to the previous/main screen. here the problem come in picture, now i am unable to touch the button or the UIImageView. both are not responding, but app is not crashed and nor frozen. what is wrong in that? Plz help in this... ----- EDIT: Approach First: SWVController *swvController = [[SWVController alloc] init]; UINavigationController *viewNavController = [[UINavigationController alloc] initWithRootViewController:swvController]; UIViewController *pushController = [[UIViewController alloc] init]; UIWindow *win = [[UIApplication sharedApplication] keyWindow]; [win addSubview:pushController.view]; [pushController presentModalViewController:viewNavController animated:YES]; In the swvController i have back button that calls the dismissModelViewController on click result is the Main screen ctrls are not responding to touch – sandy 3 hours ago Second approach: SWVController *swvController = [[SWVController alloc] init]; UINavigationController *viewNavController = [[UINavigationController alloc] initWithRootViewController:swvController]; UIViewController *pushController = [[UIViewController alloc] init]; [self addSubview:pushController.view]; [pushController presentModalViewController:viewNavController animated:YES]; In the swvController i have back button that calls the dismissModelViewController on click result is the swvController's back button on navbar is not responding – sandy 3 hours ago 3rd approach: SWVController *swvController = [[SWVController alloc] init]; UINavigationController *viewNavController = [[UINavigationController alloc] initWithRootViewController:swvController]; SampleAppAppDelegate *appdel = [[UIApplication sharedApplication] delegate]; [appdel.viewController presentModalViewController:viewNavController animated:YES]; result is working fine, but the problem is i dont want to use SampleAppAppDelegate,i want to give my small Uiview (100x80) as a ctrl to other person , where my ctrl will not able to get the AppDelegate of thet app at run time. – sandy 3 hours ago

    Read the article

  • how to generate an event

    - by user262325
    Hello everyone I created a subclass from UIView #import <UIKit/UIKit.h> @interface MeeSelectDropDownView : UIView { UILabel *mainText; UIImage *bgImg; UIImageView *bgView; UIImageView *originView; NSMutableArray *labelArray; int selectedItem; BOOL inSelectTag; float _defaultHeight; } @property (nonatomic , retain) UIImage *bgImg; @property (nonatomic , retain) UIImageView *bgView; @property (nonatomic , retain) NSMutableArray *labelArray; @property (nonatomic , retain) UIImageView *originView; @property (nonatomic , retain) UILabel *mainText; @property (nonatomic , readonly) int selectedItem; - (void) setViewHeight:(float)aheight; -(void) showDropList; -(void) hiddenDropList; -(void) setStringByArray:(NSArray*)array; -(void)hiddenLabels { for(UILabel *aLabel in labelArray){ [aLabel removeFromSuperview]; } } Is it possible to generate an Event from function 'hiddenLabels' to inform and do somethings Thanks interdev

    Read the article

  • How i zoom perticular part of UIScrollView?

    - by Rajendra Bhole
    HI, I develop an application in which i want to implement the splash screen, on that splash screen i want to bind the scrollView and UIImage. My code as follow, -(void)splashAnimation{ window = [[UIWindow alloc] initWithFrame:CGRectMake(0, 0, 320, 420)]; //scrollView = [[UIScrollView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]]; scrollView = [[UIScrollView alloc] initWithFrame:[window bounds]]; scrollView.pagingEnabled = NO; scrollView.bounces = NO; UIImage *image = [UIImage imageNamed:@"splash.png"]; UIImageView *imageView = [[UIImageView alloc] initWithImage:image]; imageView.userInteractionEnabled = NO; [scrollView addSubview:imageView]; [scrollView setDelegate:self]; //[scrollView release]; } - (void)applicationDidFinishLaunching:(UIApplication *)application { [self splashAnimation]; [self initControllers]; [window addSubview:[mainTabBarController view]]; [window makeKeyAndVisible]; } On my given code the one blank window comes up and stay on. I want to on that blank screen bind my splash.png. *The Above problem is solved* My current code is scrollView.pagingEnabled = NO; scrollView.bounces = NO; UIImage *image = [UIImage imageNamed:@"splash.png"]; UIImageView *imageView = [[UIImageView alloc] initWithImage:image]; imageView.userInteractionEnabled = NO; [scrollView addSubview:imageView]; scrollView.maximumZoomScale = 4.0f; scrollView.minimumZoomScale = 1.0f; CGRect rect = CGRectMake(119, 42, 208, 166); [scrollView zoomToRect:rect animated:YES]; [scrollView setDelegate:self]; [window addSubview:scrollView]; [window makeKeyAndVisible]; i want to zoom the particular part of scrollView.

    Read the article

  • UIScrollView loading an image

    - by treasure
    i must say i m not very good at this. and you probably know that (cause noone bothers to answer my questions) but i will keep on trying!!! lol here it goes! i wanted to find an "easy" way to use the pinch/zoom function on my app! so i decided to use a UIScrollView. so far so good. i load my image from an sqlite db like so: - (void)loadView { self.title = @"ScrollView"; imageView = [[UIImageView alloc] initWithFrame:[UIScreen mainScreen].applicationFrame]; imageView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth; imageView.contentMode = UIViewContentModeScaleAspectFit; imageView.backgroundColor = [UIColor blackColor]; self.view = imageView;} and - (void)viewWillAppear:(BOOL)animated {imageView.image = entity.imageA} I followed a tutorial but i cnnot seem to be able to load my image at all: - (void)vieDidLoad { imageView = [[UIImageView alloc] initWithFrame:[UIScreen mainScreen].applicationFrame]; imageView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth; imageView.contentMode = UIViewContentModeScaleAspectFit; imageView.backgroundColor = [UIColor blackColor]; //when i have this it does load the image but when i cant load my own data!! /*UIImageView *tempImageView = [[UIImageView alloc] initWithImage:[UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:@"http://www.austinbull.com/clonemines.png"]]]]; [self setMyImage:tempImageView]; [tempImageView release];*/ myScrollView.contentSize = CGSizeMake(imageView.frame.size.width, imageView.frame.size.height); myScrollView.maximumZoomScale = 4.0; myScrollView.minimumZoomScale = 0.75; myScrollView.clipsToBounds = YES; myScrollView.delegate = self; [myScrollView addSubview:imageView]; self.view = scrollView; [window makeKeyAndVisible]; } (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView { return myImage; } any help would be appreciated! thank you for your time!

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >