Search Results

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

Page 4/45 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • UIView autoresize problem

    - by Chonch
    Hey, I have a UIView with several subviews: one UIImageView and a couple of UIViews. When I change the frame property of the view, the imageView's size changes accordingly, but the rest of the subviews remain in their original size! I can't figure out what I'm doing wrong. Can anybody help? Thanks,

    Read the article

  • UIView "suck" animation

    - by igul222
    I'd like to use the UIView "sucking" transition (view is "sucked" into a point) referenced here: http://iphonedevwiki.net/index.php/UIViewAnimationState#Using_suckEffect The method above, however, uses private APIs, which makes it next to useless for an App Store app. How can I recreate a similar effect without relying on private APIs? I'm guessing the answer has to do with OpenGL, although I have zero experience there.

    Read the article

  • UIView animation cancels previous animation?

    - by user281300
    Hi I have an NSTIMER that counts the time, and on t = 10, it fires an animation but during that time it might happen that another animation is running. This causes the previously running animation to cut off. Any idea? i thought UIVIEW animations were ran in diff threads. I cannot use a willstop selector here since t = 10 might happen while another animation is running and might not have ended yet.

    Read the article

  • UIView not handling touches

    - by Biranchi
    Hi All, I have set my status bar hidden in my Application. [application setStatusBarHidden:YES]; I have added an UIView on the window as a subview at 0,0,320,40. But I am not able to get touches on my View ? What is the problem ??? Thanks

    Read the article

  • Orientation in a UIView added to a UIWindow

    - by Ken
    OK, bear with me. I have a UIView which is supposed to cover the whole device (UIWindow) to support an image zoom in/out effect I'm doing using core animation where a user taps a button on a UITableViewCell and I zoom the associated image. The zooming is performing flawlessly, what I haven't been able to figure out is why the subview is still in portrait mode even though the device is in landscape. An illustration below: http://www.weeshsoft.com/images/IMG_0482.jpg I do have a navigation controller but this view has been added to the UIWindow directly. Signed, Baffled in Atlanta

    Read the article

  • get rotation direction of UIView on touchesMoved

    - by mlecho
    this may sound funny, but i spent hours trying to recreate a knob with a realistic rotation using UIView and some trig. I achieved the goal, but now i can not figure out how to know if the knob is rotating left or right. The most pertinent part of the math is here: - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch = [touches anyObject]; CGPoint pt = [touch locationInView:self]; float dx = pt.x - iv.center.x; float dy = pt.y - iv.center.y; float ang = atan2(dy,dx); //do the rotation if (deltaAngle == 0.0) { deltaAngle = ang; initialTransform = iv.transform; }else { float angleDif = deltaAngle - ang; CGAffineTransform newTrans = CGAffineTransformRotate(initialTransform, -angleDif); iv.transform = newTrans; currentValue = [self goodDegrees:radiansToDegrees(angleDif)]; } } ideally, i could leverage a numeric value to tell me if the rotation is positive or negative.

    Read the article

  • How to push UIViewController into UINavigationController from seperate UIView of different UIViewCon

    - by Kundan
    I have a UIViewController(AbcViewController) with NavigationController.AbcViewController uses UIView(AbcView) as its view. AbcView has a UITableView. I have set This TableView's datasource in AbcViewController and delegate in its SuperView i.e. AbcView. How will I push another UIViewController(XyzViewcontroller) into navigationController when I select a row in this table because it gives "error: request for member 'navigationController' in something not a structure or union" when I do this : [self.navigationController pushViewController:xyzViewcontroller animated:TRUE]; I also did this : AbcViewController *parentVC; [parentVC.navigationController pushViewController:xyzViewcontroller animated:TRUE]; Though it builds successfully but XyzViewcontroller's view does not appear. It does not push XyzViewcontroller's view into navigationController. Thanks For Any Help.

    Read the article

  • Building a clip area in a UIView from path objects in its subviews

    - by hkatz
    I'm trying to produce a clipping area in a UIView that's generated from path objects in its subviews. For example, I might have one subview containing a square and another containing a circle. I want to be able to produce a clip in the parent superview that's the union of both these shapes. Can someone explain how to do this? About all I've been able to figure out so far is that: 1 - the superview's drawRect: method is called before its subviews' drawRects are, and 2 - the ContextRef that's accessible in all three instances is the same. Other than that I'm stumped. Thanks, Howard

    Read the article

  • UIView transparency shows how the sausages are made!

    - by quixoto
    I have a UIView container that has two UIImageViews inside it, one partially obscuring the other (they're being composed like this to allow for occasional animation of one "layer" or another. Sometimes I want to make this container 50% alpha, so what the users sees fades. Here's the problem: setting my container view to 50% alpha makes all my subviews inherit this as well, and now you can see through the first subview into the second, which in my application has a weird X-Ray effect that I'm not looking for. What I'm after, of course, is for what the user currently sees to become 50% transparent-- the equivalent of flattening the visible view into one bitmap, and then making that 50% alpha. What are my best bets for accomplishing this? Ideally would like to avoid actually, dynamically flattening the views if I can help it, but best practices on that welcome as well. Am I missing something obvious? Since most views have subviews and would run into this issue, I feel like there's some obvious solution here. Thanks!

    Read the article

  • Save UIView's representation to file.

    - by fish potato
    What is the easiest way to save UIView's representation to file? My solution is, UIGraphicsBeginImageContext(someView.frame.size); [someView drawRect:someView.frame]; UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); NSString* pathToCreate = @"sample.png"; NSData *imageData = [NSData dataWithData:UIImagePNGRepresentation(image)]; [imageData writeToFile:pathToCreate atomically:YES]; but it seems tricky, and I think there must be more efficient way to do this.

    Read the article

  • Updating UIView subclass contents

    - by Brett
    Hi; I am trying to update a UIView subclass to draw individual pixels (rectangles) after calculating if they are in the mandelbrot set. I am using the following code but am getting a blank screen: //drawingView.h ... -(void)drawRect:(CGRect)rect{ CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSetRGBFillColor(context, r, g, b, 1); CGContextSetRGBStrokeColor(context, r, g, b, 1); CGRect arect = CGRectMake(x,y,1,1); CGContextFillRect(context, arect); } ... //viewController.m ... - (void)viewDidLoad { [drawingView setX:10]; [drawingView setY:10]; [drawingView setR:0.0]; [drawingView setG:0.0]; [drawingView setB:0.0]; [super viewDidLoad]; [drawingView setNeedsDisplay]; } Once I figure out how to display one pixel, I'd like to know how to go about updating the view by adding another pixel (once calculated). Once all the variables change, how do I keep the current view as is but add another pixel? Thanks, Brett

    Read the article

  • Pushing to a UITable inside a UIView from a UITableview

    - by Michael Robinson
    I can firgure out how to push a UIView from a Tableview and have the "child" details appear. Here is the view I'm trying to load: Here is the code that checks for children and either pushes a itemDetail.xib or an additional UITable, I want to use the above .xib but load the correct contents "tableDataSource" into the UItable: - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { //Get the dictionary of the selected data source. NSDictionary *dictionary = [self.tableDataSource objectAtIndex:indexPath.row]; //Get the children of the present item. NSArray *Children = [dictionary objectForKey:@"Children"]; if([Children count] == 0) { ItemDetailViewController *dvController = [[ItemDetailViewController alloc] initWithNibName:@"ItemDetailView" bundle:[NSBundle mainBundle]]; [self.navigationController pushViewController:dvController animated:YES]; [dvController release]; } else { //Prepare to tableview. FirstTab *rvController = [[FirstTab alloc] initWithNibName:@"FirstView" bundle:[NSBundle mainBundle]]; //Increment the Current View rvController.CurrentLevel += 1; //Set the title; rvController.CurrentTitle = [dictionary objectForKey:@"Title"]; //Push the new table view on the stack [self.navigationController pushViewController:rvController animated:YES]; rvController.tableDataSource = Children; [rvController release]; } } Thanks for the help. I see lots of stuff on this but can't find the correct push instructions.

    Read the article

  • iPhone UIScrollView embedded UIView is clipped

    - by scc
    Hello. I have an iPad UIView subclass (we'll call LargerUIView) with which I do a bunch of drawing via drawRect: once asked. That all appears to be working, and looks the way I like. I'm at the point now of trying to get scrolling working (just in the horizontal to begin), yet when I try to scroll, what shows below is black (ie, appears to have never been drawn). That doesn't surprise me as it's likely been clipped. Looking for suggestions. Here's what I'm doing so far: MyAppDelegate.m - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { CGRect scrollRect = CGRectMake(0, 0, 768, 1024); UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:scrollRect]; LargerUIView *view = (LargerUIView *)[viewController view]; [scrollView addSubview:view]; [scrollView setContentSize:CGSizeMake(768, pageHeight)]; [scrollView setContentMode:UIViewContentModeRedraw]; [scrollView setClipsToBounds:YES]; [window addSubview:scrollView]; [scrollView release]; // Without this next line, the "frontmost" (ie, most recently added subview) // is the MoxiesAppetizerMenu - which is not equipped to handle scrolling/UIEvents [window sendSubviewToBack:view]; // Show it all. [window makeKeyAndVisible]; return YES; } Any suggestions? Have tried changing "setClipsToBounds" to NO as well.

    Read the article

  • Custom UIView using CALayers disappears after 180º rotation or navigation controller pop

    - by Steve Madsen
    I have a created a custom UIView subclass that is exhibiting some strange behavior. It is a spinning wheel selector, and for performance reasons it is drawn entirely into two CALayer instances. The bottom layer is the wheel itself, which is rotated using setAffineTransform: according to touches. The top layer is eye candy. drawRect: is fairly simple. If the control hasn't been drawn yet (or it's been invalidated), it calls a method that creates the images and assigns them to the layer contents property. - (void) drawRect:(CGRect)rect { if (imageLayer == nil) { [self drawIntoImageLayer]; } [self updateWheelRotation]; } When the view controller using this view first appears, everything is fine. There are two instances where the view completely disappears, however: If the device is rotated a full 180°. After a view controller is popped off the navigation stack and the view becomes visible again. drawRect: is not called either time. Interestingly enough, it IS called after a 90° orientation change, and that causes the view to re-appear. How can I ensure that a custom view using CALayers is redrawn properly in these situations?

    Read the article

  • Loading a UIView from a UITableview

    - by Michael Robinson
    I can firgure out how to push a UIView from a Tableview and have the "child" details appear. Here is the view I'm trying to load: Here is the code that checks for children and either pushes a itemDetail.xib or an additional UITable, I want to use the above .xib but load the correct contents "tableDataSource" into the UItable: - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { //Get the dictionary of the selected data source. NSDictionary *dictionary = [self.tableDataSource objectAtIndex:indexPath.row]; //Get the children of the present item. NSArray *Children = [dictionary objectForKey:@"Children"]; if([Children count] == 0) { ItemDetailViewController *dvController = [[ItemDetailViewController alloc] initWithNibName:@"ItemDetailView" bundle:[NSBundle mainBundle]]; [self.navigationController pushViewController:dvController animated:YES]; [dvController release]; } else { //Prepare to tableview. FirstTab *rvController = [[FirstTab alloc] initWithNibName:@"FirstView" bundle:[NSBundle mainBundle]]; //Increment the Current View rvController.CurrentLevel += 1; //Set the title; rvController.CurrentTitle = [dictionary objectForKey:@"Title"]; //Push the new table view on the stack [self.navigationController pushViewController:rvController animated:YES]; rvController.tableDataSource = Children; [rvController release]; } } Thanks for the help. I see lots of stuff on this but can't find the correct push instructions.

    Read the article

  • UIViewController not loading a UIView

    - by Cosizzle
    Hey, I'm playing around with a script my teacher provided for a table based application. However I can't seem to get my own view to load. Files: SubViewOneController (which is a sub view, also has a nib) TapViewController (Custom UIView I created and want to add to a cell) RootViewController (Main controller which loads in the views) SimpleNavAppDelegate How it works: Within the RootViewController, there's an NSArray that holds NSDictionary objects which is declared in the -(void)awakeFromNib {} method - (void)awakeFromNib { // we'll keep track of our views controllers in this array views = [[NSMutableArray alloc] init]; // when using alloc you are responsible for it, and you will have to release it. // ==================================================================================================== // ==================================================================================================== // LOADING IN CUSTOM VIEW HERE: // allocate a set of views and add to our view array as a dictionary item TapViewController *tapBoardView = [[TapViewController alloc] init]; //push onto array [views addObject:[NSDictionary dictionaryWithObjectsAndKeys: @"Tab Gestures", @"title", tapBoardView, @"controller", nil]]; [tapBoardView release]; //release the memory // ==================================================================================================== // ==================================================================================================== SubViewOneController *subViewOneController = [[SubViewOneController alloc] init]; // This will set the 2nd level title subViewOneController.title = @"Swipe Gestures"; //set it's title //push it onto the array [views addObject:[NSDictionary dictionaryWithObjectsAndKeys: @"Swipe Gestures", @"title", subViewOneController, @"controller", nil]]; [subViewOneController release]; //release the memory } Later on I set the table view: - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { // OUTPUT -- see console NSLog(@"indexPath %i", indexPath.row); // OUTPUT: tapController: <TapViewController: 0x3b2b360> NSLog(@"view object: %@", [views objectAtIndex:indexPath.row]); // OUTPUT: view object: controller = <TapViewController: 0x3b0e290>; title = "Tab Gestures"; // ----- Hardcoding the controller and nib file in does work, so it's not a linkage issue ------ // UNCOMMENT TO SEE WORKING -- comment below section. //TapViewController *tapContoller = [[TapViewController alloc] initWithNibName:@"TapBoardView" bundle:nil]; //NSLog(@"tapController: %@", tapContoller); //[self.navigationController pushViewController:tapContoller animated:YES]; // ----- Random Tests ----- //UIViewController *targetViewController = [[views objectAtIndex: 0] objectForKey:@"controller"]; // DOES NOT WORK // LOADS THE SECOND CELL (SubViewOneController) however will not load (TapViewController) UIViewController *targetViewController = [[views objectAtIndex: indexPath.row] objectForKey:@"controller"]; NSLog(@"target: %@", targetViewController); // OUTPUT: target: <TapViewController: 0x3b0e290> [self.navigationController pushViewController:targetViewController animated:YES]; } Reading the comments you should be able to see that hardcoding the view in, works - however trying to load it from the View NSArray does not work. It does however contain the object in memory, seeing that NSLog proves that. Everything is linked up and working within the TapViewController nib file. So ya, im kinda stuck on this one, any help would be great! Thanks guys

    Read the article

  • Converting OpenGL co-ordinates to lower UIView (and UIImagePickerController)

    - by John Qualis
    Hi, I am new to OpenGL over iPhone. I am developing an iPhone app similar to a barcode reader but with an extra OpenGL layer. The bottommost layer is UIImagePickerController, then I use UIView on top and draw a rectangle at certain co-ordinates on the iphone screen. So far everything is OK. Then I am trying to draw an OpenGL 3-D model in that rectangle. I am able to load a 3-D model in the iPhone based on this code here - http://iphonedevelopment.blogspot.com/2008/12/start-of-wavefront-obj-file-loader.html I am not able to transform the co-ordinates of the rectangle into OpenGL co-ordinates. Appreciate any help. Do I need to use a matrix to translate the currentPosition of the 3-D model so it is drawn within myRect? The code is given below.. Appreciate any help/pointers in this regards. John -(void)setupView:(GLView*)view { const GLfloat zNear = 0.01, zFar = 1000.0, fieldOfView = 45.0; GLfloat size; glEnable(GL_DEPTH_TEST); glMatrixMode(GL_PROJECTION); size = zNear * tanf(DEGREES_TO_RADIANS(fieldOfView) / 2.0); CGRect rect = view.bounds; glFrustumf(-size, size, -size / (rect.size.width / rect.size.height), size / (rect.size.width / rect.size.height), zNear, zFar); glViewport(0, 0, rect.size.width, rect.size.height); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glClearColor(0.0f, 0.0f, 0.0f, 0.0f); NSString *path = [[NSBundle mainBundle] pathForResource:@"plane" ofType:@"obj"]; OpenGLWaveFrontObject *theObject = [[OpenGLWaveFrontObject alloc] initWithPath:path]; Vertex3D position; position.z = -8.0; position.y = 3.0; position.x = 2.0; theObject.currentPosition = position; self.plane = theObject; [theObject release]; } (void)drawView:(GLView*)view; { static GLfloat rotation = 0.0; glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glLoadIdentity(); glColor4f(0.0, 0.5, 1.0, 1.0); // the coordinates of the rectangle are // myRect.x, myRect.y, myRect.width, myRect.height // Do I need to use a matrix to translate the currentPosition of the // 3-D model so it is drawn within myRect? //glOrthof(-160.0f, 160.0f, -240.0f, 240.0f, -1.0f, 1.0f); [plane drawSelf]; }

    Read the article

  • Converting OpenGL coordinates to lower UIView (and UIImagePickerController)

    - by John Qualis
    I am new to OpenGL on the iPhone. I am developing an iPhone app similar to a barcode reader but with an extra OpenGL layer. The bottommost layer is UIImagePickerController, then I use UIView on top and draw a rectangle at certain coordinates on the iPhone screen. So far everything is OK. Then I am trying to draw an OpenGL 3-D model in that rectangle. I am able to load a 3-D model in the iPhone based on this code here - http://iphonedevelopment.blogspot.com/2008/12/start-of-wavefront-obj-file-loader.html I am not able to transform the coordinates of the rectangle into OpenGL coordinates. Appreciate any help. Do I need to use a matrix to translate the currentPosition of the 3-D model so it is drawn within myRect? The code is given below. -(void)setupView:(GLView*)view { const GLfloat zNear = 0.01, zFar = 1000.0, fieldOfView = 45.0; GLfloat size; glEnable(GL_DEPTH_TEST); glMatrixMode(GL_PROJECTION); size = zNear * tanf(DEGREES_TO_RADIANS(fieldOfView) / 2.0); CGRect rect = view.bounds; glFrustumf(-size, size, -size / (rect.size.width / rect.size.height), size / (rect.size.width / rect.size.height), zNear, zFar); glViewport(0, 0, rect.size.width, rect.size.height); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glClearColor(0.0f, 0.0f, 0.0f, 0.0f); NSString *path = [[NSBundle mainBundle] pathForResource:@"plane" ofType:@"obj"]; OpenGLWaveFrontObject *theObject = [[OpenGLWaveFrontObject alloc] initWithPath:path]; Vertex3D position; position.z = -8.0; position.y = 3.0; position.x = 2.0; theObject.currentPosition = position; self.plane = theObject; [theObject release]; } - (void)drawView:(GLView*)view; { static GLfloat rotation = 0.0; glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glLoadIdentity(); glColor4f(0.0, 0.5, 1.0, 1.0); // the coordinates of the rectangle are // myRect.x, myRect.y, myRect.width, myRect.height // Do I need to use a matrix to translate the currentPosition of the // 3-D model so it is drawn within myRect? //glOrthof(-160.0f, 160.0f, -240.0f, 240.0f, -1.0f, 1.0f); [plane drawSelf]; }

    Read the article

  • Animating removeFromSuperview

    - by brettr
    I'd like to animate the transition from a subview back to the super view. I display the subview using: [UIView beginAnimations:@"curlup" context:nil]; [UIView setAnimationDelegate:self]; [UIView setAnimationDuration:.5]; [UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:self.view cache:YES]; [self.view addSubview:self.mysubview.view]; [UIView commitAnimations]; The above works fine. It's going back to the super view that I don't get any animation: [UIView beginAnimations:@"curldown" context:nil]; [UIView setAnimationDelegate:self]; [UIView setAnimationDuration:.5]; [UIView setAnimationTransition:UIViewAnimationTransitionCurlDown forView:self.view cache:YES]; [self.view removeFromSuperview]; [UIView commitAnimations]; Is there something different I should be doing to get the subview to animate when removed?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >