I am subclassing a UIView and overwrite the drawRect method. I'm noticing that the view's drawrect is only being called when the view first loads. After that it is never called again. How to I make sure it gets called after an orientation change? I've tried calling setNeedsDisplay on the view before and after the rotation and that doesn'...
I'm trying to display a UILabel on top of a UINavigationController. The problem is that when I add the UILabel as a subview of UIWindow it will not automatically rotate since it is not a subview of UIViewController (UIViewController automatically handles updating subviews during rotations).
This is the hierarchy I was using:
UIWindow
...
Hi - first time asker, long-time lurker.
I am trying to create an iPhone view that has a date/time picker on the bottom half of the screen, and a grouped, single-section, four-row table view on the top half of the screen (almost identical to the one Apple shows in Fig. 2-4 of their View Controller Programming Guide (but then never goes ...
I have the following code to do a UIView animation:
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1.0];
[UIView setAnimationDelegate:self];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:mapView.view cache:NO];
[self addSubview:detailView];
[mapView removeFromSuperview];
[UIView c...
could you please show me some example please?
...
Hi,
I was looking up how to create a view programmatically and found the following example code:
self.view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)];
This works great, except I don't like that it hardcodes the size of the screen. Is there a way to look up the size of the screen? An important point someone brought up ...
Hi All,
I originally setup some conditions using CGRectIntersectsRect for some collision detection which worked fine. In the greater scale of things I only need part of the view to be detected.
So originally within the ViewController it was comparing 2 UIviews.
Now what I need to do is collision detection of subViews within 2 differe...
I can access and show self.view and see the frame in the log but when I try to access self.view.frame I get null. Below is the log output of
NSLog(@"Show self.view:%@",self.view);
NSLog(@"Show self.view.frame:%@",self.view.frame);
-
2010-03-28 11:08:43.373 vivmed_CD_Tab[20356:207] Show self.view:<UITableView: 0x4001600; frame = (0 ...
I'm trying to get a basic flip animation transition working when I push a controller inside a navigation. The code below flips the view, however the view appears first (each element fades in), and then the flip occurs. Is it possible to do a flip animation with a UINavigationController?
Any pointers would be great, the examples I've fou...
I am trying to load my UIViewController and corresponding UIView programmatically in the AppDelegate class. I have the following in the applicationDidFinishLaunchingMethod of the AppDelegate class:
(void)applicationDidFinishLaunching:(UIApplication *)application {
NSLog(@"--- AppDelegate applicationDidFinishLaunching Start");
// Over...
Hello,
Once a view is called from appdelegate, it is properly loaded but not autosized correctly, on the bottom you see last lines from previous view! On xib file, view mode property is set to scale to fill but I tried others and still happening the same... Thanks for any idea to solve it!
...
I want a UIView with a glowing or pulsing effect, like the status bar during a call on the iPhone. Does anyone know how I would go about doing this? I've experimented with NSTimer but can't seem to find how to go about this.
Thanks!
...
I want to call this method in a user defined function
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
Is it possible ?? if yes,How ?? Pl. guide me.
...
Hi!
Some important part of my code is running in viewDidLoad and I was wondering is there was a way to unload an UIView so that when my controller calls it again it must go through viewDidLoad again?
Thanks a lot!
...
I have several UIImageView objects which have been rotated and scaled. Because they are just background images, and represent an non-highlighted-state, I want to draw them to the canvas of the view so that I can get rid of them in memory. The view has a big bitmap anyways, so it would save a lot of memory to put them in there rather than...
I recently asked a question regarding collision detection within subviews, with a perfect answer. I've come to the last point in implementing the collision on my application but I've come across a new issue.
Using convertRect was fine getting the CGRect from the subView. I needed it to be a little more complex as it wasn't exactly rec...
I'm building a prototype iPad app that draws diagrams. I have the following view hierarchy:
UIView
UIScrollView
DiagramView : UIView
TabBar
NavigationBar
And a UIViewController subclass holding all that together.
Before drawing the diagram the first time I calculate the dimensions of the diagram, and set the DiagramView frame to t...
Hello,
I have added a CALayer to the UIView of my app:
CATransition *animation = [CATransition animation];
[animation setDelegate:self];
[animation setDuration:0.35];
[animation setTimingFunction:UIViewAnimationCurveEaseInOut];
animation.type = @"pageCurl";
animation.fillMode = kCAFillModeForwards;
...
I have to invoke a method present in a view controller who's reference is available in the view. When I try to call the method like any other method, for some reason, iPhone just ignores the call. Can somebody explain as to why this happens and also how can I go about invoking this method?
In the view I have this method:
-(void) touc...
My application goes back and forth between Portrait and Landscape. I have all of my content(labels, uiimageviews, uilabels) lined up to relocate for both orientations. However, the only change when the device is actually rotated. When I cycle between tabs after it has been rotated it just shows up autosized and not the way I have it s...