This is probably a really dumb question, but I can't seem to figure it out. My iPad application supports landscape and portrait orientations -so far so good. but when I'm in landscape mode, if I switch from one view to another there's a little rotation animation, even though I didn't rotate the device. It is as if the UIView I'm loading ...
Im wondering what I am doing wrong:
Create xib and add on it UIView "FirstView".
Under this UIView "FirstView" add another UIView "SecondView".
On the FirstViewController load SecondView from nib.
it works at this point. Whats not working is that the "FirstView" doesnt seem to change after point 3.
So the "SecondView" is properly loa...
I'm trying to handle touch events with touchesBegan in an overlay to a parent UIView but also allow the touch input to pass through to sibling UIViews underneath. I expected there would be some straight-forward way to process a touch event and then say "now send it to the next responder as if this one didn't exist", but all I can find i...
I want to determine which view touches occurred in for the entire application, for the purpose of logging touches so that I can go through the logs later and determine what the user did. I know I could subclass UIView and override touchesBegan/Ended to log those, but I am using many instances of UIButton, UISlider, etc in Interface Build...
Hi,
I'm trying to clip a region of an UIView, into a UIImage for later reuse.
I've worked out this code from some snippets:
CGRect _frameIWant = CGRectMake(100, 100, 100, 100);
UIGraphicsBeginImageContext(view.frame.size);
[view.layer renderInContext:UIGraphicsGetCurrentContext()];
//STEP A: GET AN IMAGE FOR THE FULL FRAME
UIIm...
I'm doing some animations using the UIView animation and presentModalViewController. Through the simulator it looks fine but on device its rather choppy. Even fairly basic views for example a viewController with a UISearchBar, UITableView (empty) with a a custom color and a button on the nav bar is jerky when animated through presentModa...
Kinda confusing title but oh well.
I have a UIScrollView in my viewController, in that is 3 UIViews with some buttons in each. I download data from a server and populate it into the view and this works as soon as you start scrolling the UIScrollView, but sometimes the buttons only partially load.
Usually its the button label without my...
I have a application which contains a moving image and i want to animate the image using a my custom animation.
How can i associate an IBAction event with the image?
How can i detect the coordinates on screen where the user touched the image?
Please Give Your Suggestions.
Thanks in advance and Your Suggestions are Most Welcome.
...
I am going to restructure my game to use multiple uiviews. Is the following flow correct ?
I create 6 uiviews ( one for each sprite).
game loads root uiview.
root uiview init method loads 5 subviews using self addSubview.
in the game controller I update each uiview each game tic.
the game controller will need a pointer to each Uivie...
Hi guys
I'm new to iPhone programming, and in fact, programming of any kind. For nearly a year now I've been teaching myself C, and then Objective-C, and for the past few months I've been making an iPhone game, so far of which i'm pretty proud of.
Anyways I've hit quite a stumbling block and I've been trying to figure it out for a whil...
Hi all,
I have subclassed UIView so I can draw some lines in it. In this UIView are a whole bunch of buttons which I decided to create as a method that drawRect calls after the lines are drawn. It works but sometimes only part of the button renders. If i remove the button creation and instead add the UIButton in the subclassed UIViews p...
Hi all,
I have a drawrect method in my main UIView which draws 8 sprites every game tic. I want to seperate out each of these sprites into a seperate UIView.
I am trying to split out one sprite first as a test.
So far I have added a UIView as subview to my main view and set it's frame. This draws a black box on the view. My question i...
Hi everybody!
I have a view that contains a ScrollView opening two xibs.
There is a button on a Xib contained in ScrollView.
I want that after clicking the button, open a new view outside of the ScrollView.
But I can not open a new view outside the Scrollview. = /
Any suggestions?
Thanks.
...
First off - I'm not using MapKit. I'm using my own controls for something entirely different. But the annotation view is something I'd like to mimmic. I've seen other applications with similar views to indicate state or actions on other controls. However, scanning through the class library I can't find a view already in the SDK. Do I hav...
I'm working on an app that has three table view controllers in a navigation stack. The root view controller and the second VC have toolbars, but I want to add a subview to the second view controller like this. (The color is just there for visualization.)
I want to add the view programmatically, since I haven't been able to do it with I...
If I add the button straight everything goes fine. I'd really like to add it inside a view and still be able to click it. Here's the code:
UIView *containerView =
[[[UIView alloc]
initWithFrame:CGRectMake(0, 0, 300, 60)]
autorelease];
UIButton *footerButton = [UIButton buttonWithType:UIButtonTypeCustom];
footerButton.frame = CGRectMake(...
Hey,
In an application I'm developing, everything starts from a navigation controller, which then loads up several pages.
My question is, how can I load up a new view ABOVE this? The closest I've got is to do this in the App Delegate:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launch...
Hello,
I am encountering a strange problem. I created a UIView that takes place at the bottom of the screen
(0,431,320,49) and then I want to deal with touch events.
When I touch the upper side of the UIView, it works. But when I touch the bottom side (I mean, more than 20px in relative position), the touchBegan event is not fired.
It...
Hi guys!
I got three views.
UIView *view1;
UIView *view2;
UIView *view3;
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
UITouch *touch =[touches anyObject];
CGPoint startPoint =[touch locationInView:self.view];
}
But i want that the toch-action only go in view2. It doesnt work if i make: locationInView:view2
-(...
I am launching a simple UIView with a textField - let's call it orderSetNameView - upon a button tap. I wish to make this view modal, but without using a [UIViewController presentModalViewContoller:animated:]. It seems I could simply set textInputView.exclusiveTouch = YES to achieve that.
Apple documentation says about exclusiveTouch,...