Search Results

Search found 1125 results on 45 pages for 'uiview'.

Page 21/45 | < Previous Page | 17 18 19 20 21 22 23 24 25 26 27 28  | Next Page >

  • UInavigationcontroller,UItableview and UIview

    - by sudhakarilla
    I have one issue with UInavigationcontroller In my firstview i have button.If i click that button it should open tableview. if i click that tableviewcell is select the nextview willbe open.In my nextview i have backbutton click return to the tableview.it is used to navigationbar 2view and 3view. it doesnot tabbarcontroller.. Please help in this issue.

    Read the article

  • Add UIView Above All Other Views, Including StatusBar

    - by Mike Stead
    I'm wanting to create a view (UIControl) which blocks all input and shows a UIActivityIndicatorView while authenticating a user. The UIActionSheet and UIAlertView both manage to add a black semi-transparent view over the top of all other views to block input and I'd like to do similar. I've tried adding my view to the top UIWindow in the [[UIApplication sharedApplication] windows] array, and while this does place it above the UIKeyboard if it's visible, it doesn't place it over the StatusBar (which makes sense). My next attempt was to extend UIAlertView, remove all of its subviews and set its layer.contents = nil, then add the ActivityIndicator as a subview. This works well, but I can't seem to kill the default bouncy transition of the UIAlertView when you call it to "show". Does anyone have any pointers towards the best way tackle this problem that gives me full control? Oh and I know blocking input is not great but I do ensure it's for a short period of time and it has the benefit of making it clear to the user that their action, which must complete for them to progress, is processing.

    Read the article

  • UIView remove itself from UIScrollView

    - by alex25
    Hi! Following Scenario: I have a = UIViewController A that contains a UIScrollView I have a second UIViewController "B" (amongst other things it contains a button) and add it to the ScrollView of A myView *mView = [[myView alloc] init]; [myScrollView addSubview:mView.view]; Is there a way that once the button is pressed that it(view) removes itself from the scrollview? I thought in the direction of setting the delegate of mView to "A" ?! But not sure how that should work in detail.... Any suggestions? Thanks!

    Read the article

  • Show UIView for app presentation only once in iOS

    - by André Muniz
    I need to show an UIScrollView with some pages for present the app to user when launched for the first time. My slides are working correctly, lefting the logic to present it. Is a good practice to set the UIScrollViewController as root controller and set a NSUserDefault variable to control the presentation and redirect to main controller or set the main ViewController as root normally and call the presentation view if needed is a better approach? If there is a better way to do this can someone help? Thanks.

    Read the article

  • rotating a circle in UIView?

    - by senthilmuthu
    HI, i want to draw a circle in DrawRect through context like pie chart(took from tutorial) thorugh UITouch? i have given the code as follows,how can i rotate ? any help please? define PI 3.14159265358979323846 define snapshot_start 360 define snapshot_finish 360 static inline float radians(double degrees) { return degrees * PI / 180; } - (void)drawRect:(CGRect)rect { // Drawing code CGRect parentViewBounds = self.bounds; CGFloat x = CGRectGetWidth(parentViewBounds)/2; CGFloat y = CGRectGetHeight(parentViewBounds)*0.55; // Get the graphics context and clear it CGContextRef ctx = UIGraphicsGetCurrentContext(); CGContextClearRect(ctx, rect); // define stroke color CGContextSetRGBStrokeColor(ctx, 1, 1, 1, 1.0); // define line width CGContextSetLineWidth(ctx, 4.0); // need some values to draw pie charts double snapshotCapacity =20; double rawCapacity = 100; double systemCapacity = 1; int offset = 5; double pie1_start = 315.0; double pie1_finish = snapshotCapacity *360.0/rawCapacity; double system_finish = systemCapacity*360.0/rawCapacity; CGContextSetFillColor(ctx, CGColorGetComponents( [[UIColor greenColor] CGColor])); CGContextMoveToPoint(ctx, x+2*offset, y); CGContextAddArc(ctx, x+2*offset, y, 100, radians(snapshot_start), radians(snapshot_start+snapshot_finish), 0); CGContextClosePath(ctx); CGContextFillPath(ctx); // system capacity CGContextSetFillColor(ctx, CGColorGetComponents( [[UIColor colorWithRed:15 green:165/255 blue:0 alpha:1 ] CGColor])); CGContextMoveToPoint(ctx, x+offset,y); CGContextAddArc(ctx, x+offset, y, 100, radians(snapshot_start+snapshot_finish+offset), radians(snapshot_start+snapshot_finish+system_finish), 0); CGContextClosePath(ctx); CGContextFillPath(ctx); /* data capacity */ CGContextSetFillColor(ctx, CGColorGetComponents( [[UIColor colorWithRed:99/255 green:184/255 blue:255/255 alpha:1 ] CGColor])); CGContextMoveToPoint(ctx, x, y); CGContextAddArc(ctx, x, y, 100, radians(snapshot_start+snapshot_finish+system_finish+offset), radians(snapshot_start), 0); CGContextClosePath(ctx); CGContextFillPath(ctx); }

    Read the article

  • iPhone: Animating a view when another view appears/disappears

    - by MacTouch
    I have the following view hierarchy UITabBarController - UINavigationController - UITableViewController When the table view appears (animated) I create a toolbar and add it as subview of the TabBar at the bottom of the page and let it animate in with the table view. Same procedure in other direction, when the table view disappears. It does not work as expected. The animation duration is OK, but somehow not exact the same as the animation of the table view when it becomes visible When I display the table view for the second time, the toolbar does not disappear at all and remains at the bottom of the parent view. What's wrong with it? - (void)animationDone:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context { UIView *toolBar = [[[self tabBarController] view] viewWithTag:1000]; [toolBar removeFromSuperview]; } - (void)viewWillAppear:(BOOL)animated { UIEdgeInsets insets = UIEdgeInsetsMake(0, 0, 44, 0); [[self tableView] setContentInset:insets]; [[self tableView] setScrollIndicatorInsets:insets]; // Toolbar initially placed outside of the visible frame (x=320) UIView *toolBar = [[UIToolbar alloc] initWithFrame:CGRectMake(320, 480-44, 320, 44)]; [toolBar setTag:1000]; [[[self tabBarController] view] addSubview:toolBar]; [UIView beginAnimations:nil context:nil]; [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; [UIView setAnimationDuration:0.35]; [toolBar setFrame:CGRectMake(0, 480-44, 320, 44)]; [UIView commitAnimations]; [toolBar release]; [super viewWillAppear:animated]; } - (void)viewWillDisappear:(BOOL)animated { UIView *toolBar = [[[self tabBarController] view] viewWithTag:1000]; [UIView beginAnimations:nil context:nil]; [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; [UIView setAnimationDuration:0.35]; [UIView setAnimationDidStopSelector:@selector(animationDone:finished:context:)]; [toolBar setFrame:CGRectMake(320, 480-44, 320, 44)]; [UIView commitAnimations]; [super viewWillDisappear:animated]; }

    Read the article

  • how to detect touch on UIView with UIimage ontop of it?

    - by Silent
    hello all, i want to use a UIview and a UIImage ontop of it with a text box and button i want the user to drag it when the UIview or anything in the view is touched, what would be the best way to implement this method? the UIView is on a single View Controller and using Interface Builder to make my UIviews and UIimages.

    Read the article

  • Modify coverflow component ,add backview ?

    - by hib
    Hi all , I am developing an iPhone application in which I needs to implement a Coverflow component. I got a good library from here It is working nicely . Now I want to show a different back view with 6 buttons when a user double taps on the image in the coverflow . For that the tapkulibrary author has implemented a delegate method called which is : - (void) coverflowView:(TKCoverflowView*)coverflowView coverAtIndexWasDoubleTapped:(int)index{ TKCoverView *cover = [coverflowView coverAtIndex:index]; //if(cover == nil) return; // [UIView beginAnimations:nil context:nil]; // [UIView setAnimationDuration:1]; // [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:cover cache:YES]; // [UIView commitAnimations]; *********************MY BACK View ******************************* UIView *c; NSArray *array = [[NSBundle mainBundle] loadNibNamed:@"TestMine" owner:nil options:nil]; c = [array objectAtIndex:0]; [cover addSubview:c]; [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration:1.0]; [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:cover cache:YES]; [UIView setAnimationDuration:1.0]; CGAffineTransform transform = CGAffineTransformMakeScale(1.2, 1.2); cover.transform = transform; [UIView commitAnimations]; NSLog(@"Index: %d",index); } I am not much aware about the drawing code used in this example my back view is not working perfectly . So can anyone modify me this method or code to push my back view when double tapping the image and again double tapping shows the real image again . I need help .

    Read the article

  • UIView's frame, bounds, center, origin, when to use what?

    - by Boon
    UIView has the concept of frame, bounds, center, and origin, and they all seem to be interrelated. Most of the time, I deal with frame when setting the position and size of a UIView (or subclass). I understand that the frame is using global coordinate system and the bounds is using coordinate of the local view (therefore it's x and y are 0, but not always), but it's still confusing to me when to use what. Question: Under what context (and what's the right time) the other properties (bounds, center, origin) should be used?

    Read the article

  • Create a UIView Subclass that calls a delegate function whenever it's parent viewController appears?

    - by Andrew Johnson
    UIViewControllers have viewWillAppear, viewDidDisappear, etc. delegate methods. I would like to create a UIView subclass that can be added to a viewController's view, and when that UIViewController apears or disappears, a delegate function is called. I could easily do this by putting function calls in the UIViewController viewWillAppear/viewWillDisappear delegate functions, but how can I encapsulate this behavior in the UIView?

    Read the article

  • Help needed with drawRect:

    - by Andrew Coad
    Hi, I'm having a fundamental issue with use of drawRect: Any advice would be greatly appreciated. The application needs to draw a variety of .png images at different times, sometimes with animation, sometimes without. A design goal that I was hoping to adhere to is to have the code inside drawRect: very simple and "dumb" - i.e. just do drawing and no other application logic. To draw the image I am using the drawAtPoint: method of UIImage. Since this method does not take a CGContext as a parameter, it can only be called within the drawRect: method. So I have: - (void)drawRect:(CGRect)rect { [firstImage drawAtPoint:CGPointMake(firstOffsetX, firstOffsetY)]; } All fine and dandy for one image. To draw multiple images (over time) the approach I have taken is to maintain an array of dictionaries with each dictionary containing an image, the point location to draw at and a flag to enable/suppress drawing for that image. I add dictionaries to the array over time and trigger drawing via the setNeedsDisplay: method of UIView. Use of an array of dictionaries allows me to completely reconstruct the entire display at any time. drawRect: now becomes: - (void)drawRect:(CGRect)rect { for (NSMutableDictionary *imageDict in [self imageDisplayList]) { if ([[imageDict objectForKey:@"needsDisplay"] boolValue]) { [[imageDict objectForKey:@"image"] drawAtPoint:[[imageDict objectForKey:@"location"] CGPointValue]]; [imageDict setValue:[NSNumber numberWithBool:NO] forKey:@"needsDisplay"]; } } } Still OK. The code is simple and compact. Animating this is where I run into problems. The first problem is where do I put the animation code? Do I put it in UIView or UIViewController? If in UIView, do I put it in drawRect: or elsewhere? Because the actual animation depends on the overall state of the application, I would need nested switch statements which, if put in drawRect:, would look something like this: - (void)drawRect:(CGRect)rect { for (NSMutableDictionary *imageDict in [self imageDisplayList]) { if ([[imageDict objectForKey:@"needsDisplay"] boolValue]) { switch ([self currentState]) { case STATE_1: switch ([[imageDict objectForKey:@"animationID"] intValue]) { case ANIMATE_FADE_IN: [self setAlpha:0.0]; [UIView beginAnimations:[[imageDict objectForKey:@"animationID"] intValue] context:nil]; [UIView setAnimationDelegate:self]; [UIView setAnimationCurve:UIViewAnimationCurveEaseIn]; [UIView setAnimationDuration:2]; [self setAlpha:1.0]; break; case ANIMATE_FADE_OUT: [self setAlpha:1.0]; [UIView beginAnimations:[[imageDict objectForKey:@"animationID"] intValue] context:nil]; [UIView setAnimationDelegate:self]; [UIView setAnimationCurve:UIViewAnimationCurveEaseOut]; [UIView setAnimationDuration:2]; [self setAlpha:0.0]; break; case ANIMATE_OTHER: // similar code here break; default: break; } break; case STATE_2: // similar code here break; default: break; } [[imageDict objectForKey:@"image"] drawAtPoint:[[imageDict objectForKey:@"location"] CGPointValue]]; [imageDict setValue:[NSNumber numberWithBool:NO] forKey:@"needsDisplay"]; } } [UIView commitAnimations]; } In addition, to make multiple sequential animations work correctly, there would need to be an outer controlling mechanism involving the animation delegate animationDidStop: callback that would set the needsDisplay entries in the dictionaries to allow/suppress drawing (and animation). The point that we are at now is that it all starts to look very ugly. More specifically: drawRect: starts to bloat quickly and contain code that is not "just drawing" code the UIView needs implicit awareness of the application state the overall process of drawing is now spread across three methods at a minimum And on to the point of this post: how can I do this better? What would the experts out there recommend in terms of overall structure? How can I keep application state information out of the view? Am I looking at this problem from the wrong direction. Is there some completely different approach that I should consider?

    Read the article

  • Iphone page curl effect

    - by dragon
    I am using this code for Page curl effect ....Its work fine in simulator and device... But its not (setType:@"pageCurl") apple documented api , this caused it to be rejected by the iPhone Developer Program during the App Store review process: animation = [CATransition animation]; [animation setDelegate:self]; [animation setDuration:1.0f]; animation.startProgress = 0.5; animation.endProgress = 1; [animation setTimingFunction:UIViewAnimationCurveEaseInOut]; [animation setType:@"pageCurl"]; [animation setSubtype:@"fromRight"]; [animation setRemovedOnCompletion:NO]; [animation setFillMode: @"extended"]; [animation setRemovedOnCompletion: NO]; [[imageView layer] addAnimation:animation forKey:@"pageFlipAnimation"]; So i changed and using like this [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration:1]; [UIView setAnimationDelegate:self]; [UIView setAnimationBeginsFromCurrentState:YES]; [UIView setAnimationCurve:UIViewAnimationCurveLinear]; [UIView setAnimationWillStartSelector:@selector(transitionWillStart:finished:context:)]; [UIView setAnimationDidStopSelector:@selector(transitionDidStop:finished:context:)]; // other animation properties [UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:imageView cache:YES]; // set view properties [UIView commitAnimations]; In this above code i want to stop the page curl effect at midway.. But i cant stop it in midway like map applications in ipod... Is this any fix for this? or Is there any apple documented methods used for page curl effect in ipod touch? I am searching lot. but didnt get any answer ? can anyone help me? Thanks in advance..plz

    Read the article

  • iPhone: contentInset isn't animating

    - by Cuzog
    In my app, I have a table view. When the user clicks a button, a UIView overlays part of that table view. It's essentially a partial modal. That table view is intentionally still scrollable while that modal is active. To allow the user to scroll to the bottom of the table view, I change the contentInset and scrollIndicatorInsets values to adjust for the smaller area above the modal. When the modal is taken away, I reset those inset values. The problem is that when the user has scrolled to the bottom of the newly adjusted inset and then dismisses the modal, the table view jumps abruptly to a new scroll position because the inset is changed instantly. I would like to animate it so there is a transition, but the beginAnimation/commitAnimations methods aren't affecting it for some reason. Any ideas as to why the values aren't getting animated? Any help is greatly appreciated! The relevant code from the table view controller is here: - (void)viewDidLoad { [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(modalOpened) name:@"ModalStartedOpening" object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(modalDismissed) name:@"ModalStartedClosing" object:nil]; [super viewDidLoad]; } - (void)modalOpened { [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration:0.5]; [UIView setAnimationDelegate:self]; self.tableView.contentInset = UIEdgeInsetsMake(0, 0, 201, 0); self.tableView.scrollIndicatorInsets = UIEdgeInsetsMake(0, 0, 201, 0); [UIView commitAnimations]; } - (void)modalDismissed { [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration:0.5]; [UIView setAnimationDelegate:self]; self.tableView.contentInset = UIEdgeInsetsMake(0, 0, 0, 0); self.tableView.scrollIndicatorInsets = UIEdgeInsetsMake(0, 0, 0, 0); [UIView commitAnimations]; }

    Read the article

  • How to load View from NIB into another NIB?

    - by Sheehan Alam
    I have two NIB's ParentViewController.xib ChildViewController.xib ParentViewController.xib contains a UIView and a UIViewController. ChildViewController.xib contains a UIButton I want ChildViewController.xib to load in the ParentViewController.xib's UIView I have done the following: Created @property for UIView in ParentViewController Connected File's Owner to UIView in ParentViewController Set UIViewController in ParentViewController's NIB Name property to ChildViewController in Interface Builder Set ChildViewController view property to UIView in ParentViewController I was hoping this would load ChildViewController into my UIView in ParentViewController but no luck. I did get the following warning, which could be the culprit: 'View Controller (Child View)' has both its 'NIB Name' property set and its 'view' outlet connected. This configuration is not supported. I also have added additional code in ParentViewController's viewDidLoad(): - (void)viewDidLoad { [super viewDidLoad]; ChildViewController *childViewController = [[ChildViewController alloc]initWithNibName:@"ChildViewController" bundle:nil]; childViewController.view = self.myView; } Any thoughts on why ChildViewController does not load in the UIView of ParentViewController?

    Read the article

  • how to stop animation after using beginAnimations?

    - by www.ruu.cc
    i use the following code to do a string rolling, but how to stop the animation? [UIView beginAnimations:@"ruucc" context:NULL]; [UIView setAnimationDuration:12.8f]; [UIView setAnimationCurve:UIViewAnimationCurveLinear]; [UIView setAnimationDelegate:self]; [UIView setAnimationRepeatAutoreverses:NO]; [UIView setAnimationRepeatCount:999999]; frame = label1.frame; frame.origin.x = -12; label1.frame = frame; [UIView commitAnimations];

    Read the article

  • Unable to load detached NIB in View

    - by Sheehan Alam
    I have two NIB's ParentViewController.xib ChildViewController.xib ParentViewController.xib contains a UIView and a UIViewController. ChildViewController.xib contains a UIButton I want ChildViewController.xib to load in the ParentViewController.xib's UIView I have done the following: Created @property for UIView in ParentViewController Connected File's Owner to UIView in ParentViewController Set UIViewController in ParentViewController's NIB Name property to ChildViewController in Interface Builder Set ChildViewController view property to UIView in ParentViewController I was hoping this would load ChildViewController into my UIView in ParentViewController but no luck. I did get the following warning, which could be the culprit: 'View Controller (Child View)' has both its 'NIB Name' property set and its 'view' outlet connected. This configuration is not supported. I also have added additional code in ParentViewController's viewDidLoad(): - (void)viewDidLoad { [super viewDidLoad]; ChildViewController *childViewController = [[ChildViewController alloc]initWithNibName:@"ChildViewController" bundle:nil]; childViewController.view = self.myView; } Any thoughts on why ChildViewController does not load in the UIView of ParentViewController?

    Read the article

  • How to load a NIB inside of a view in another NIB?

    - by Sheehan Alam
    I have two NIB's ParentViewController.xib ChildViewController.xib ParentViewController.xib contains a UIView and a UIViewController. ChildViewController.xib contains a UIButton I want ChildViewController.xib to load in the ParentViewController.xib's UIView I have done the following: Created @property for UIView in ParentViewController Connected File's Owner to UIView in ParentViewController Set UIViewController in ParentViewController's NIB Name property to ChildViewController in Interface Builder Set ChildViewController view property to UIView in ParentViewController I was hoping this would load ChildViewController into my UIView in ParentViewController but no luck. I did get the following warning, which could be the culprit: 'View Controller (Child View)' has both its 'NIB Name' property set and its 'view' outlet connected. This configuration is not supported. I also have added additional code in ParentViewController's viewDidLoad(): - (void)viewDidLoad { [super viewDidLoad]; ChildViewController *childViewController = [[ChildViewController alloc]initWithNibName:@"ChildViewController" bundle:nil]; childViewController.view = self.myView; } Any thoughts on why ChildViewController does not load in the UIView of ParentViewController?

    Read the article

  • How to recreate the default UIView the same as the default tableView:viewForHeaderInSection:?

    - by Hoang Pham
    I tried to implement the - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section to get the text label of the header in section of black color instead of the white color, but it looks so different from the default one created by the SDK, mine is so ugly. How to recreate the UIView with exactly the same as the one from the SDK? From Apple documentation: Discussion The table view uses a fixed font style for section header titles. If you want a different font style, return a custom view (for example, a UILabel object) in the delegate method tableView:viewForHeaderInSection: instead.

    Read the article

< Previous Page | 17 18 19 20 21 22 23 24 25 26 27 28  | Next Page >