uiview

Subclassing UIView or composing with UIView

I'll start by saying what I want to do because I'm unsure if I'm asking the right question. I'm making a grid based map and am going to hold an array of objects to keep the state and presentation of the map. Each object will be of a Tile class. Should I be subclassing UIView or sublass NSObject and have an ivar of UIView. I was also plan...

Flatten subviews

I have a graphics app I am writing that has a UIView that has several UIImageViews as subviews added to it over time. I want to flatten all these subviews for performance reasons as it is slowing down over time. What is the simplest way to "flatten" these layers. ...

subview outside parentview frame events

Hi, I'm adding programmatically an UIView B to another UIView A. The A frame is {{0, 372}, {320, 44}}. B UIView is add at {0, -74} and is {320, 74} wide. My problem is that B touch events are not handled. More precisely touch events are handled to a sibling UITableView of UIView A wich ends at {0, 372} even if B UIview is displayed ov...

To select a context

How can I select the context of a specific UIView among the several ones I have on my screen and quartz draw on it? ...

Push different views from a top-level table view in iPhone SDK

I have a grouped tableview that then tries to push a new view depending on which cell is selected. The issue is, that cells drill-down to views that are not necessarily tables - thus using coding examples from the reference books available is not that helpful - the views I'm trying to push are webview, tableview, textview etc. I have ob...

Load UITableView inside a UIView

Do I need a UITableViewController in addition to my UIViewController if I want to load a UITableView as a subview along with several other views at one time? ...

Apply barrel distortion to UIView

I've got a UIScrollview which fills a landscape screen, which contains a small tree of UIViews around inside it which I can scroll horizontally. I'd like to apply a barrel distortion to the scrollview, so that as the subviews move from the outside to the centre of the scrollview, they change shape. What is a good what to go about applyi...

Recursive adding self.view to self.view?

I need add to my active main view a new subview. And this subview should be with all content which placed on main view. Subview has a frame = view.frame / 2. I trying implement some solutions (below), but there are no results (( First off CGRect frame = CGRectMake(100, 140, 250, 250); UIView *view = [self.view copy]; view.fram...

iPhone + UIView

Hi, I am having a strange problem: In -(void)viewWillAppear:(BOOL)animated method I use: [[UIApplication sharedApplication] setStatusBarHidden:YES animated:NO]; It means I am hiding the StatusBar, since I am hiding it, all the controls in my View are shifted upside by some distance when I run the application so, it appears in differ...

Creating a button on View1 from View2

Hi, I'm in a struggle. I have this app with two views. View1 empty. View2 with a textfield and an OK button. I want to accomplish the following: On View2 the user inserts the name for a button; its title. (the way user reaches view2 is not relevant. It could be with a button or a tabbar button on View1.) After pressing OK button, View...

iPhone Adding Views on Windows Practice

I'm learning how Objective-C on the iPhone layers views onto the main window. I've tried remaking a basic program to draw two different colored rectangular views onto the main UIView for an app, but it does not seem to work. My current output is a white screen. However, when I close the application, it briefly shows the two rectangles...

Multiple UIView instance doesn't work

Hi, I have subclass UIView class in a Bounce class with Accelerometer. This Bounce class show an image and move it on the screen. When the iPhone device is moved, this image Bounce on the screen. When I create multiple instance, only last instance work properlty: // in the MainViewController.m Bounce *heart[100]; for(int i = 0; i < ...

Custom UIView built with Interface Builder accessible/positionable via Interface Builder

This shouldn't be this confusing. I have a custom UIView with a bunch on controls on it. UILabels, buttons, etc. I've created this Nib using Interface Builder. I want to be able to position this custom uiview on another UIView using the interface builder. How do I link my UIView custom class, to the nib? initWithCoder gets called, ...

how to add UITableView to a view based application: iPhone sdk question

I have a View based application that navigates between all views properly. And now I have to add a UITableView to this application, I am unable to do that. I could add a UITableView, thats fine, but no idea about adding data source to it. I searched a lot and found only examples begin with navigation based applications. I have created a...

Different alpha for subviews in the same container

I have a question similar to the http://stackoverflow.com/questions/1269637/can-you-override-a-parent-uiviews-alpha-value-on-one-of-its-subviews In some cases I want to show custom semi-transparent full-screen overlay view over current view. The trick is that I want it to have custom navigation bar at the top and some other contents (le...

Will UIView autoResizingMask handle a navigation bar which may or may not be there?

I have a UITableViewController which displays its own top navigation bar when it's presented modally, but uses the UINavigationController navigation bar when it's pushed onto the navigation stack. I currently have code which programmatically moves origin of the table view depending on whether it has the navigation bar. When it uses its...

How to make an iPhone view transparent?

I have developed a project that has a single view. Now I want the view to be transparant so that I can see the iPhone menu. Is this possible and if so, how? Thanks. ...

Load a nib into an UIView?

Hey guys, I need some help. I've got a segmented control. if segment 0 is clicked it shows a UIView, containing a uitableview. If segment 2 is clicked it shows another UIView which contains a uitableview as well. These two tableviews got the same datasource. But i want the second tableview to have an other datasource. SO i thougth of ...

Design view in Interface Builder to load lazily in UIViewController

I've managed to get my myself confused... I've got a fairly complex View Controller much of which is developed programatically. I'd like to pop up a "dialog" on top of the view controller at some point and I'd like to "design" that view in Interface Builder because it's fairly straightforward (background UIImageView, some UILabels and a ...

How to get UIView frame position after transform ?

Hi, I want to get the current position of a UIView after a transform rotate has been applied to it. How can i do that ? In the UIView doc i found this about the transform property : "If this property is not the identity transform, the value of the frame property is undefined and therefore should be ignored." I tried to use center...