Search Results

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

Page 12/45 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • Methods in Customized View did not get invoke in AppDelegate, Why?

    - by NorthKyut
    I want the methods pauseGame in customized UIView - MyGameView get invoked when the phone is locked or interrupted. So I have a pauseGame method but it can't stop the timer when user lock screen (command+L). The lock screen did appear but the game still running at the background. So I added the testPause method to MyGameView and MyGameAppDelegate and and put a breakpoint to debug it. When screen locked it, the screen lock appeared and the code did stop at the breakpoint. But when I tried to step into the testPause method, it didn't take me to the method in MyGameView (it just passed it, not skipped) and no message was printed on terminal by NSLog. Why? What did I miss? // // MyGameAppDelegate.h // MyGame // #import <UIKit/UIKit.h> @class MyGameViewController; @class MyGameView; @interface MyGameAppDelegate : NSObject { UIWindow *window; MyGameViewController *viewController; MyGameView *view; } @property (nonatomic, retain) IBOutlet UIWindow *window; @property (nonatomic, retain) IBOutlet MyGameViewController *viewController; @property (nonatomic, retain) IBOutlet MyGameView *view; @end // // MyGameAppDelegate.m // MyGame // #import "MyGameAppDelegate.h" #import "MyGameViewController.h" #import "MyGameView.h" @implementation MyGameAppDelegate @synthesize window; @synthesize viewController; @synthesize view; - (void)applicationWillResignActive:(UIApplication *)application { /* Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. */ [view pauseGame]; [view testPause]; } @end // // MyGameView.h // MyGame @interface MyGameView : UIView { - (void)pauseGame; - (void)testPause; @end // // MyGameView.m // MyGame // #import "MyGameView.h" #import "AtlasSprite.h" #import "MyGameViewController.h" #import "SecondViewController.h" @implementation MyGameView - (void)pauseGame { [theTimer invalidate]; theTimer = nil; } - (void)testPause{ NSLog(@"TestPause"); } @end

    Read the article

  • How to show a UINavigationController with an UIButton on the Iphone?

    - by Claudio
    Hi, in my application the first view is an UIView with a couple of uilabel and an uibutton to do the login. I would to show an uinavigationcontroller with a table after the login, so with the action of the button. I know how to set up a working Navigation Controller starting with the Xcode Template but i dont know how to load this as a "Second View" Any help?

    Read the article

  • Wrapping/warping a CALayer/UIView (or OpenGL) in 3D (iPhone)

    - by jbrennan
    I've got a UIView (and thus a CALayer) which I'm trying to warp or bend slightly in 3D space. That is, imagine my UIView is a flat label which I want to partially wrap around a beer bottle (not 360 degrees around, just on one "side"). I figured this would be possible by applying a transform to the view's layer, but as far as I can tell, this transform is limited to rotation, scale and translation of the layer uniformly. I could be wrong here, as my linear algebra is foggy at this point, to say the least. How can I achieve this?

    Read the article

  • UIScrollView strange zoom behavior when content is a UIView subclass

    - by sigsegv
    Hi, I'm experiencing the following: I created a UIView subclass with a CATiledLayer as backing layer by overriding the layerClass method. The layer properties (delegate, tileSize, etc) are set in the initWithFrame: method of the subclass. +(Class)layerClass { return [CATiledLayer class]; } -(id)initWithFrame:(CGRect)frame { if(self = [super initWithFrame:frame]) { renderer = [[MFPDFRenderer alloc]init]; tiledLayer = (CATiledLayer *)[self layer]; [tiledLayer setFrame:frame]; [tiledLayer setLevelsOfDetail:2]; [tiledLayer setLevelsOfDetailBias:3]; [tiledLayer setTileSize:CGSizeMake(512, 512)]; [tiledLayer setDelegate:renderer]; } return self; } Then I add an instance of said class as the content of an UIScrollView and set UIScrollView properties and implement the required delegate's methods. Everything works fine but when zooming the scroll view keep repositioning itself on its center. It's hardly noticeable when zooming in the center of the content, but unbearable otherwise. The same scroll view works fine when I use as (zoomable) content any other view such as an UIImageView or even a normal UIView with a CATiledLayer with the same properties and delegate of the subclass implementation as sublayer. When I check layer bounds and frame in the drawLayer:inContext: method of the delegate I get the following result as the zoom increase UIView with CATiledLayer as sublayer: 2010-04-03 21:05:33.499 Renderer[89293:4903] Layer: (0.000, 0.000) 320.000 x 460.000 2010-04-03 21:05:33.500 Renderer[89293:4903] Bounds: (0.000, 0.000) 320.000 x 460.000 2010-04-03 21:05:33.529 Renderer[89293:4903] Layer: (0.000, 0.000) 320.000 x 460.000 2010-04-03 21:05:33.534 Renderer[89293:4903] Bounds: (0.000, 0.000) 320.000 x 460.000 Custom subclass: 2010-04-03 21:04:15.969 Renderer[88957:4903] Layer: (0.000, 0.000) 657.910 x 945.746 2010-04-03 21:04:15.970 Renderer[88957:4903] Bounds: (0.000, 0.000) 320.000 x 460.000 2010-04-03 21:04:17.428 Renderer[88957:4903] Layer: (-0.000, 0.000) 766.964 x 1102.510 2010-04-03 21:04:17.429 Renderer[88957:4903] Bounds: (0.000, 0.000) 320.000 x 460.000 [...] 2010-04-03 21:19:10.388 Renderer[92573:4903] Layer: (-0.000, 0.000) 905.680 x 1301.916 2010-04-03 21:19:10.388 Renderer[92573:4903] Bounds: (0.000, 0.000) 320.000 x 460.000 I suppose that's the culprit or at least another symptom. I can add that I get the same erratic behavior if my subclass is built over a standard CALayer with the same renderer. Any suggestion will be appreciated!

    Read the article

  • Add UIView behind UITableView in UITableViewController code

    - by Drew C
    I would like to use a fixed image as the background in a simple grouped table view in my iPhone program. Unfortunately, no matter what I do, the background is always solid white. I have followed several supposed solutions on this site and others to no avail. Here is the relavant code in the viewDidLoad method of the table view controller class (note, this code uses a solid blue color rather than an image for simplicity's sake): self.tableView.opaque = NO; self.tableView.backgroundColor = [UIColor clearColor]; UIView *backgroundView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)]; backgroundView.backgroundColor = [UIColor blueColor]; [self.tableView.window addSubview:backgroundView]; [backgroundView release]; I suspect that I am not positioning the backgroundView view in the right place. I have tried sendToBack:, bringToFront:, and others but I always just get a white background. Is it possible to do this from within the UITableViewController? Must I use Interface Builder?

    Read the article

  • Locating the UIView that UITableView scrolls over

    - by Coocoo4Cocoa
    Hi all, I'm working on trying to obtain the UIView that UITableView scrolls over, if scrolling is enabled. Typically, the background is white, and if you push the UITableView out of its bounds, you'll see a background. I'm trying to set this background to a UIColor of blackColor. I can't seem to find the appropriate one to tag. I've tried the following code in my UIViewController: - (void)loadView { [super loadView]; UITableView *aTableView = [[[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStylePlain] autorelease]; [aTableView setScrollEnabled:YES]; [self.view setBackgroundColor:[UIColor blackColor]]; [self.view addSubview:aTableView]; self.tableView = aTableView; } The color still stays white. Seems I'm hitting the wrong UIView. Any idea? Thanks.

    Read the article

  • Adding a UIView to a UITableViewCell via cell.contentView

    - by Robert Eisinger
    I have a class called GraphView that extends UIView that basically draws a small little line chart. I need one of these graphs at the top of each section in my UITableView. So I tried by creating a separate cell at the top of one of my sections and then on that cell I did: [cell.contentView addSubview:graphView]; [graphView release]; But when I scroll down, it's like the graph is glitchy and it shows up in random spots along the UITableView. Anyone have ideas or insight? Is there a better way to incorporate another UIView into the top of each section in my UITableView?

    Read the article

  • How to create a smooth CATransition effect

    - by Futur
    The CATransition what i have implemented works really fine but not smooth, i could see the previous uiview screens during the transition, I am just doing this, CATransition *animation = [CATransition animation]; [animation setDuration:0.1]; [animation setType:kCATransitionPush]; [animation setSubtype:kCATransitionFromRight]; [animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]]; [[objView layer] addAnimation:animation forKey:@"SwitchToView"]; For moving forward and for moving back wards, CATransition *animation = [CATransition animation]; [animation setDuration:0.1]; [animation setType:kCATransitionPush]; [animation setSubtype:kCATransitionFromLeft]; [animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]]; [[objRemovableView layer] addAnimation:animation forKey:@"SwitchToView"]; The effect of sliding is not smooth, is there any other way we can do this which works very smooth? Please help

    Read the article

  • addSubview like modal

    - by brettr
    How can I get a UIView to transition via addSubview like the presentModalViewController does? The available animations don't seem to do this. I would use the modal but I have a navigation bar at the top and don't want to disable it. Also, the modal overlays on the navigation bar. If there is a way to have it so the modal doesn't disable the nav bar, I can go with that approach. But since it is a modal, I don't think that is possible.

    Read the article

  • CALayer drawInContext vs addSublayer

    - by Michael
    How can I use both of these in the same UIView correctly? I have one custom subclassed CALayer in which I draw a pattern within drawInContext I have a another in which I set an overlay PNG image as the contents. I have a third which is just a background. How do I overlay all 3 of these items? [self.layer addSublayer:bottomLayer]; // this line is the problem [squaresLayer drawInContext:viewContext]; [self.layer addSublayer:imgLayer]; The other 2 by themselves draw correctly if I do them in that order. No matter where I try and put bottomLayer, it always prevents squaresLayer from drawing. The reason I need 3 layers is I intend to animate the colors in the background and custom layers. The top layer is just a graphical overlay.

    Read the article

  • What library is used for the main menu in the facebook iOS app?

    - by Seth
    I'm making an app that has more options than will easily fit into a UITabBarController. I wanted to use something like what the facebook app has for its main menu. My guess is that it isn't proprietary to facebook, because the SCVNGR app uses something similar. This library lets you re-order the icons the way you can re-order the apps from the main menu (i.e. press and hold - icons jiggle - you can drag them around). Does anyone know what library provides this UIView? I'd like to use it if possible. Thanks!

    Read the article

  • Bring to front DatePicker on an UITextField

    - by crazyfr
    Hi, When an UITextField is firstResponder, I would like to bring to front an UIDatePicker (bottom part of the screen) without the "going down keyboard" (no call to UITextField resignFirstResponder). The aim is to process like UIKeyboard of UITextField which pop-up on nearly everything when it becomeFirstResponder. modalViewController seems to be fullscreen only. - showDatePicker:(id)sender { if([taskName isFirstResponder]) [taskName resignFirstResponder]; [self.view.window addSubview: self.pickerView]; // size up the picker view and compute the start/end frame origin (...) [UIView commitAnimations]; } This example is an animation of keyboard going down, and DatePicker going up, behind and not in front. Do you know a solution ? A piece of code would be welcome. Thanks in advance.

    Read the article

  • Changing view size when orientation changes

    - by Eyal Redler
    I want my UIView subclass to behave so that when it is fitted in portrait orientation is has a certain size and another size when fitted in landscape mode. Is it possible to have the view indicate to the view controller that's resizing it when the orientation changes that it has this "ideal size"? To clarify, I'm confident that this is not something that can be done with the autoresizing mask. I also thought that sizeThatFits: would be what I need but I didn't see it get called when the orientation changed. I'm also aware that I can get this done by overriding layoutSubviews of the superview (or maybe some other method of the view controller but I would like to have this behavior embedded in the view to facilitate reuse.

    Read the article

  • Two UIViews in one .xib file?

    - by Tronic
    hi, i made a second uiview in mei .xib file. the first view is landscape and i get it by following code ItemController *newItem; newItem = [[ItemController alloc] init]; newItem.view..... how can i "activate" the second view, so i can use it with newItem.view2... is that possible? the second view is portait mode, so it should be hidden and when turning the ipad the first view should be hidden and the second gets visible. thanks

    Read the article

  • iPhone: how do I set up a clear window-size "blocker view"?

    - by Ben
    I feel like this should be obvious to me, but for some reason I can't figure this out. I have a navigation interface with nav bar, tool bar, and primary view. Sometimes the user takes an action that causes a progress indicator to appear in the middle of the view. While the progress indicator (which is a custom UIView) in spinning in the middle, I want no touch input to be allowed to go to any of the underlying interface (main view, nav bar, toolbar, etc). But this doesn't seem trivial. I've tried (and failed) to create a simple view whose only job is to swallow touch input and use it as a window subview-- no dice, it never gets the touch events (and yes, it does have userInteractionEnabled). I've tried to bolt it on as a transparent modal view controller, but those don't seem to ever be transparent. Thoughts? What am I missing? Thanks!

    Read the article

  • Touch and Drag from one view to another

    - by jollyCocoa
    Hi all! I've search for some clues on this problem without much success. Hope someone can kick me in the right direction. I am prototyping a couple of apps where I need to design my own GUI. The GUI is made up by two separated UIViews where one of them contains a small thumb of an image. I want to be able to drag this thumb from the first view to the other. Simple as that! But I haven't figured out how this is done. Here is the exact flow I am looking for: touch the thumb animate a small enlargement of the thumb drag the thumb to the other UIView drop the thumb animate a shrink of the thumb Not particularly strange, but the thumb remains related to the first view all the time. I've tried to move the thumb via the first views superview and then back to the second view, but with no luck.

    Read the article

  • iphone view controller class - how to

    - by Brodie4598
    Hello - I need to create my own UIView class and it is not something I have had to do. I created the class, then laid out the small view in IB (it's just a few labels that i will later need to add data to ). but now im stuck on how to actually put an instance of it in my main view. Can someone point me in the direction of a good tutorial? The closest thing I have done to this is creating a custom tableViewCell. DataTagViewController *dataTag = [[DataTagViewController alloc]init]; [theMap addSubView: dataTag];

    Read the article

  • how to remove sub views.

    - by mac
    Hi I have added UIButton,UITextView as subview to my view, programatically. notesDescriptionView = [[UIView alloc]initWithFrame:CGRectMake(0,0,320,460)]; notesDescriptionView.backgroundColor=[UIColor redColor]; [self.view addSubview:notesDescriptionView]; textView = [[UITextView alloc] initWithFrame:CGRectMake(0,0,320,420)]; [self.view addSubview:textView]; printf("\n description button \n"); button = [UIButton buttonWithType:UIButtonTypeRoundedRect]; [button addTarget:self action:@selector(cancel:) forControlEvents:UIControlEventTouchDown]; [button setTitle:@"OK" forState:UIControlStateNormal]; button.frame = CGRectMake(80.0, 420.0, 160.0, 40.0); [self.view addSubview:button]; here if we click the button , i need to remove the all the sub views, i am trying [self.view removeFromSuperView] but its not working any help.

    Read the article

  • iPhone animation with stretchable image

    - by ryyst
    I got a UIView subclass that draws a UIImage as its background. The image is created using the stretchableImageWithLeftCapWidth:topCapHeight: method, it has round edges. I also use an animation block inside of which I resize my view. I had hoped that during animation, the drawRect:method would get called sometimes, which would result in the background image getting drawn correctly. Unfortunately, the animation seems to render the image and then just rescale it during the animation, which obviously makes the formerly round edges getting nastily stretched. The only workaround I can imagine is put three separate UIImageViews (top cap, middle fill, bottom cap) above my original background image and then reposition the caps images and scaling the fill image. However, this seems quite complicated... Is there any better way I can prevent this from happening?

    Read the article

  • what's called after returning from presentModalViewController / dismissModalViewControllerAnimated:

    - by Reinhard
    to show a modal uiview out of my mainView I use: [self presentModalViewController:myController animated:YES]; and in MyController I close that view with: [self dismissModalViewControllerAnimated:YES]; But how can I know in the mainView that the modal was finished (to redraw my table)? Currently I set a local variable to YES in my mainView after starting the modal view an react on viewWillAppear: [self presentModalViewController:myController animated:YES]; _reloadTableData = YES; -(void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; if (_reloadTableData) { _reloadTableData = NO; [_tableView reloadData]; } } Is there a better way to do so ?

    Read the article

  • Push a detail view in UITableViewCell class

    - by luca
    My class inherit from UITableViewCell, i have make some custom transitions to push a new detail view when an image get selected. [UIView transitionWithView:self.masterView duration:0.5 options:UIViewAnimationOptionShowHideTransitionViews animations:^ { [self.masterView addSubview:self.detailImage]; } completion:nil]; My code works fine, the detailImage subview is shown with a transition, but this transition is not what i want exactly. What i want to perform is a simple transition from bottom to up. The list of UIViewAnimation doesn't contain such animation. Is there any way to use that transition without changing my class inheritance to UINavigationController ?

    Read the article

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