uiview

UIView animation VS core animation

I'm trying to animate a view sliding into view and bouncing once it hits the side of the screen. A basic example of the slide I'm doing is as follows: // The view is added with a rect making it off screen. [UIView beginAnimations:nil context:NULL]; [UIView setAnimationBeginsFromCurrentState:YES]; [UIView setAnimationDuration:0.07]; [UI...

Inactive area after device rotation

Hi all, I don't understand what's wrong in my very simple application with device rotation : I built my view with interface builder. (See screen capture here) I specified <key>UIInterfaceOrientation</key><string>UIInterfaceOrientationLandscapeRight</string> in my info.plist file. I had a (BOOL)shouldAutorotateToInterfaceOrientation:(U...

iPhone: keep text looking good after scale transform applied?

I'm applying a scale transform to a UIView that draws a number. (The number is literally being drawn with drawInRect; no UILabel in sight.) The scale transform makes the view smaller by quite a bit...say, 80% smaller. The resulting number looks a little "chunky". Is there a way that I can keep my text looking nice and anti-aliased, the ...

Recommended Way To Go Full Screen

I want to have a UIView take over the whole screen to display an image from time to time, but most of the time I'm using a UISplitViewController for the main app functionality. Is there a recommended/best practice way to do this? Right now, I have a pointer to the main window and am just adding the UIView as a sub view and bringing it to...

Need to override drawrect if your UIView is merely a container?

According to Apple's docs, "Subclasses need not override -[UIView drawRect:] if the subclass is a container for other views." I have a custom UIView subclass that is indeed merely a container for other views. Yet the contained views aren't getting drawn. Here's the pertinent code that sets up the custom UIView subclass: - (id)initWithF...

How to draw image after interfaceOrientation has been called?

example i draw UIImageView inside UIView with a.png then i rotate my device is it possible to draw another picture to replace my current picture(a.png) ? ...

[self.view addSubview:UIView] doesn't work correctly. addSubview problem

Help me. addSubview doesn't work. I want to add "ContentView" on scrollView. But "ContentView" doesn't appear on screen. "ContentView" is UIView. When I change to self.view=scrollView from [self.view addSubview:scrollView], addSubview doesn't work. Please teach me how to add UIView on this screen!! - (void)viewDidLoad { [super viewDid...

UIViewController prevent view from unloading

When my iPhone app receives a Memory warning the views of UIViewControllers that are not currently visible get unloaded. In one particular controller unloading the view and the outlets is rather fatal. I'm looking for a way to prevent this view from being unloaded. I find this behavior rather stupid - I have a cache mechanism, so when ...

subview take touch event on all window

Hello, i have a little problem on my view. I have a uiviewControler, load a xib. on this view i have a UIButton ( on touch it's work fine) I add a subview create by code (on a different class ) this view respond to her touch event. when i add this subview on my view, the event on this view are ok, but the UIButton on my first uiview n...

iPhone UIView Animation Disables UIButton Subview

So I've got a problem with buttons and animations. Basically, I'm animating a view using the UIView animations while also trying to listen for taps on the button inside the view. The view is just as large as the button, and the view is actually a subclass of UIImageView with an image below the button. The view is a subview of a container...

How do I switch from a UIView to a UITable View?

I am writing an app that does not utilize a navigationController - there is only one area that requires a UITable. However, now I am hitting a roadblock when I go to load in that (table) view, with a method such as: searchViewController = [[SearchViewController alloc] initWithNibName:@"SearchViewController"...

iPhone SDK - Slide view down while sliding new view up

How can I use [self dismissModalViewControllerAnimated:true]; to slide one view down while a new view slides up. It would have to be some code like (which seems like it would do what I want, but it doesn't): [self dismissModalViewControllerAnimated:true]; ViewController1 *controller = [[ViewController1 alloc] initWithNibName: @"ViewCont...

Transformation for twisting a UIView on iPhone

Is there a way to use CATransform3D, or similar, to twist a UIView? What I mean is to rotate the top edge of the view, but keep the bottom edge where it is. All the transformations I've looked at keep the view 'flat'. Is this more of an Open GL task? ...

Can't draw UImage in UIView::drawRect

I know this seems like a simple task, which is why I don't understand why I can't get the image to render. When I set up my UIView, I do the following: myUiView.backgroundColor = [UIColor clearColor]; myUiView.opaque = NO; I create and retain the UIImage in the init function of my UIView: image = [[UIImage imageWithContentsOfFile:[[...

How does autosize work in iPhone SDK?

Hi, I'm trying to do the following: I need to do a lot of custom things, so I subclassed everything. I'm having issues with autoresize and positioning. For instance the UIToolBar is not at the correct position. So here is the question: If you don't use UITableViewController or any other Controller, that takes care of all the posi...

How do I use a UIView subclass as a container?

I'm trying to subclass UIView to create a custom view that is essentially a container. The subclass contains a UILabel and a UIImageView- I can't make either of them show up. Here's an example of what I've been trying: In my main view controller: - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { if ...

I know I can't say myView.frame.origin.x = val - But why ?

I know that I can't use that myView.frame.origin.x = 25.0; that I have to use instead CGRect myFrame = myView.frame; myFrame.origin.x = 25.0; myView.frame = myFrame; And I'm doing it all the time (f.e. in animations), but I don't know why I must do it that way. I would like to fill that gap in my understanding. Can someone explain ...

How does one access subviews and handle groups of them?

If I want to manipulate a view I get it with [self viewWithTag:5];. Is there a better way to do this? Sometimes I need to manipulate a bunch of view (e.g. move them all out of the way. I do this by adding a UIView (e.g. UIView iHoldViews) and then adding the views, buttons, etc to this view. Then I can move the iHoldViews view and all i...

iphone view controller class - how to

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 tutori...

UIView layoutSubviews delegation

I find myself wanting support for delegating the responsibility of layoutSubviews for a UIView. This to avoid having to make a specific subclass just to implement the layoutSubviews method. I'm suspecting the reason I found my self wanting this alternative might be because I've missed some fundamental UIKit design considerations, or? Or ...