uiview

UIWebView inside programatically created UIView. How to autorotate it?

Hello, In my app, when a user selects a cell from a UITableView, I create a UIView programatically, add it to the window object, then create an UIWebView and a UIButton and add them as subviews to that view I created. myView = programatically created view webView = the UIWebView that is a subview of myView button = the UIButton that...

Cocoa Touch: Creating and Adding Custom View

I create a custom view in cocoa touch that is superclassed by UIView and in my main controller I initialize it and then add it as a subview to the main view, but when I add it to the main view it calls my initializer method again and causes an infinite loop. Am I going about creating my custom view wrong? Here is the mainView - (void)lo...

UIView as dictionary key?

I want to have a NSDictionary that maps from UIViews to something else. However, since UIViews do not implement the NSCopying protocol, I can't use them directly as dictionary keys. ...

Bring to front DatePicker on an UITextField

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

Control ( UIButton, UILable) Hides when the Video plays Again on iPhone!

Hi, I have displayed UIButton on top of Playing Movie using this code. NSArray *windows = [[UIApplication sharedApplication] windows]; if ([windows count] > 1) { // Locate the movie player window UIWindow *moviePlayerWindow = [[UIApplication sharedApplication] keyWindow]; // Add our overlay view to the movie player's subview...

Getting x/y coordinate of a UITouch...

HI, I have been trying to get the x/y coordinates from a touch on any iDevice. When getting the touch locations, everything looks ok if the touch is in the middle of the screen. But if I drag my finger to the bottom of the screen, I can only get a y coordinate of 1015. It should be getting to 1023. Same thing for dragging my finger to ...

how to remove sub views.

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

Interface Builder: Resize View From NIB

I have a custom UIViewController and a corresponding view in a nib file. The view is added to the UIWindow directly. [window addSubview:customViewController.view]; Sizes of the window and the view are default (480x320 and 460x320 correspondingly). When I create CustomViewController inside the nib file and check "Resize View From NIB"...

Loading different portrait/landscape UIViews

Hi, I have following View COntroller structure: ScrollViewController LandscapeViewController PortraitViewController Each with its own .nib The app starts in landscape mode where many landscape views are added to a scrollview. Each landscape view has its specific portrait view, so I have to assign like ID's to each of this views. Can ...

How to set view outlet for a UIViewController that contains a UITabBarController?

I have a UIViewController that contains a UITabbarController which contains a UINavigationController. When I am setting up my IB outlets, what should the File's Owner view outlet be set to? ...

how to push view to view based application?

HI I am working with View Based application, i need some suggestions from you, 1) is it possible to push a view using navigationcontroller in view based application. 2)when should we need to use navigationbased application,viewbased application,windowbased application. 3)in viewbased application i know we can addsubview, but can we...

View transform seems to be ignored when animating on iphone. Why?

I have views that can be rotated, scaled and moved around the screen. I want the view to resize and be orthogonal when the user double tap's the view to edit the textview within. The code is below. Somewhere the transform is getting reset. The NSLog statement below prints the identity transform, but a print of the transform when the ...

How do I programmatically duplicate UIViews built in interface builder?

I want to build up a sub-UIView in Interface Builder (contained within a UIScrollView) with some UILabels contained, I then want to programmatically "copy" this view adjust its left position (by multiples of its width) to achieve a "floating" left effect inside a UIScrollView. I then want to add this copied UIView back into the UIScrollV...

Odd background image resizing on animating UIView

I have a UIView in the middle of a view that I am using as a game playing area (in a 2d cocoa view). This image has a background image of the same size as the view. Resizing the view I use animation to make it look smooth (and that works fine). However, when the animation starts, the background image immediately changes size, tiling or b...

UIView Animation won't run transition

So, I've searched quite a bit for this and can't seem to find a solution. This code works: CGContextRef context = UIGraphicsGetCurrentContext(); [UIView beginAnimations:nil context:context]; [UIView setAnimationDuration:5]; [c setCenter:CGPointMake(200, 200)]; [UIView commitAnimations]; This code doesn't: CGContextRef context = UIGr...

Adding UIViewController.view to another view causes orientation problems

Short version: I'm alloc/init/retaining a new UIViewController in one UIViewControllers viewDidLoad method, adding the new View to self.view. This usually works, but it seems to mess up orientation change handling of my iPad app. Longer version: I'm building a fairly complex iPad application, involving a lot of views and viewcontrollers...

Loading an external NIB, how do I set the view property?

If I am loading a view from another NIB, how do I set the File's Owner view property? IB is not letting me hook it up to my View Controller which is loading the external NIB. My NIB looks like this: File's Owner - Identity is set to LBRootViewController First Responder LBTableViewController - Identity is set to LBTableViewController,...

Visual artifacts on UIView rotation with tiled background image.

I have an iPad app with a standard UIViewController/UIView setup - all rotations are allowed. The UIView draws some tiled image as background (the tile is 256*256 pixels): - (void)drawRect:(CGRect)rect { [[UIImage imageNamed: @"Background.png"] drawAsPatternInRect: rect]; } When I turn my iPad I can see that during the rotation th...

get bitmap from textview in android

I want to get the bitmap that is drawn when a textview is displayed but without displaying the textview in the activity. something like this: TextView t = new TextView(this); t.forceToDrawItself(); Bitmap b=t.getViewBitmap(); how is this possible? ...

When do you need to use a view controller?

I'm diving into iPhone development and one of the core concepts im trying to get my head around is view controllers. If you look at the GLPaint example on the apple dev site, you'll see a project that has... An app delegate class A uiwindow subclass And a uiview subclass And the uiview subclass implements all the core graphics paint...