subview

Scale UIView and all its children

≯℡__Kan透↙ 提交于 2019-11-27 10:42:05
问题 I have an UIView with around 50 UIButtons. All button positions were given in pixels, relative to the left upper corner of my main UIView. All (background) images used in the view are available in higher resolution. As I am porting my app from iPhone to iPad, I would like to increase the effective pixel size of the UIView. Now I'm searching a way to upscale the whole UIView by a factor of 2*. Is that possible without destroying the position of the inner elements? FYI, the UIView is designed

add UIImage in CALayer

只愿长相守 提交于 2019-11-27 10:41:17
I must add a UIImageView as subview of MapView. To do this I created a layer above the MapView. In this layer I want to put my image, but I get a white rectangle and nothing else. My image is not visible. This is the code: - (void)viewDidLoad { //...... CALayer *layer = [CALayer layer]; layer.backgroundColor = [[UIColor whiteColor] CGColor]; if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) { layer.bounds = CGRectMake(self.mapView.bounds.origin.x, self.mapView.bounds.origin.y, 80, 300); } else { layer.bounds = CGRectMake(self.mapView.frame.origin.x, self.mapView.frame.origin.y, 150,

Display navigationController on top

十年热恋 提交于 2019-11-27 08:36:29
问题 I have set up a subview "popup" in my application and I want to show a navController if the user taps a button on the subview popup. I've set up the button so far, but if I tap the button the navigationController appears under my popup!? I've searched for some solution but I didn't found any. The whole controller is actually displayed in a folder which you can find here: https://github.com/jwilling/JWFolders So the viewDidLoad belong to the folder and the rootview. I tried to make it as a

When to use f:view and f:subview

China☆狼群 提交于 2019-11-27 06:27:32
I am not sure what are the benefits of using <f:view> and <f:subview> . I noticed that one could write JSF pages without using them. What are the benefits of using those tags? BalusC <f:view> The <f:view> is only useful if you want to explicitly specify/override any of the available attributes such as locale , encoding , contentType , etc or want to attach some phase listeners. E.g. <f:view locale="#{user.locale}" encoding="UTF-8" contentType="text/html"> If you don't specify it, then the sane JSF defaults will just be used instead, which is respectively UIViewRoot#getLocale() , UTF-8 and the

Bringing a subview to be in front of all other views

微笑、不失礼 提交于 2019-11-27 05:09:51
问题 I am working on integrating an ad provider into my app currently. I wish to place a fading message in front of the ad when the ad displays but have been completely unsuccessful. I made a function which adds a subview to my current view and tries to bring it to the front using [self.view bringSubviewToFront:mySubview] The function fires on notification that the ad loaded (the notification is from the adprovider's SDK). However, my subview does not end up in front of the ad. I imagine this is

Where Does A UIAlertView Live While Not Dismissed

99封情书 提交于 2019-11-27 04:27:02
Does anyone know in whose subview an active UIAlertView is located or how to find the thread in which it is running? If you dump the contents of the windows property and all subviews of all views you can see that the UIAlertView is in a separate window that overlays the main window. Here I have a navbar with a viewcontroller and a tableview (I removed its subviews since they're not relevent). <UIWindow: 0x411fd50; frame = (0 0; 320 480); opaque = NO; autoresize = RM+BM; layer = <CALayer: 0x4120af0>> : <UILayoutContainerView: 0x4123310; frame = (0 0; 320 480); autoresize = W+H; layer = <CALayer

How to add a Container View programmatically

十年热恋 提交于 2019-11-27 04:01:43
问题 A Container View can be easily added into a storyboard through Interface Editor. When added, a Container View is of a placeholder view, an embed segue, and a (child) view controller. However, I am not able to find a way to add a Container View programmatically. Actually, I am not even able to find a class named UIContainerView or so. A name for the class of Container View is surely a good start. A complete guide including the segue will be much appreciated. I am aware of View Controller

Make a view (initialized from initWithNibName) load all its subview

丶灬走出姿态 提交于 2019-11-27 02:21:40
问题 Assuming I load a view controller from a nib, and decide to do something with one of its subview behind the scene. At a later moment in time, I would show the view of this view controller. viewController = [[MyViewController alloc] initWithNibName:@"MyViewController" bundle:nil]; [viewController.someSubview doSomething]; //later on [mainView addSubview:viewController.view]; The problem is that, the someSubview object doesn't seem to be loaded until the view appears, so the method doSomething

UICollectionView cell subviews do not resize

戏子无情 提交于 2019-11-27 00:20:37
In a CollectionView , some cells should have an additional subview or layer. The CollectionView can be told to resize it's cells, thus all content needs to resize appropriately. Currently, the cell is initialized from a nib containing a cell with imageview; the cell nib is linked to a custom UICollectionViewCell subclass, that only does the init. Autoresize subviews is checked. The CollectionView is told to resize the cell by a value derived and returned in sizeForItemAtIndexPath: . I have subclassed a FlowLayout but it only specifies ScrollDirection and Insets . All of that is working fine.

How to list out all the subviews in a uiviewcontroller in iOS?

天涯浪子 提交于 2019-11-27 00:01:32
I want to list out all the subviews in a UIViewController . I tried self.view.subviews , but not all of the subviews are listed out, for instance, the subviews in the UITableViewCell are not found. Any idea? You have to recursively iterate the sub views. - (void)listSubviewsOfView:(UIView *)view { // Get the subviews of the view NSArray *subviews = [view subviews]; // Return if there are no subviews if ([subviews count] == 0) return; // COUNT CHECK LINE for (UIView *subview in subviews) { // Do what you want to do with the subview NSLog(@"%@", subview); // List the subviews of subview [self