subview

Adding subview to MKMapView that's above the map but below the annotation views?

微笑、不失礼 提交于 2019-12-03 05:03:50
For an app I'm building, I have a custom "old map" effect PNG that I'd like to overlay on the MKMapView view. Unfortunately, neither way I've tried to do this is exactly right: Add a subview to the MKMapView (issue: the UIImageView for the PNG gets placed above the Annotation pins, which looks weird Make the image an annotation view itself and place it below the other ones (issue: on scroll, I have to move the annotation view image, and for a while there's just the regular map instead of the old-timey-effect). What I basically want to accomplish is having a subview that is layered above the

What is the correct way to remove a subview from a view hierarchy and nuke it?

為{幸葍}努か 提交于 2019-12-03 04:06:56
问题 I have a parent UIView with a number of subviews. Periodically I need to remove a subview and completely remove it from the system. What is the correct way to do this? I tried this: UIView *v = [self.containerView viewWithTag:[n integerValue]]; [v removeFromSuperview]; and got a bizarre result. Previously present UIView s disappeared as well. What's going on? 回答1: Try this: UIView *v = [self.containerView viewWithTag:[n integerValue]]; v.hidden = YES; [self.containerView bringSubviewToFront:v

iOS 7.1 removeFromSuperview crash

孤者浪人 提交于 2019-12-03 02:21:00
My app didn't have any crash until iOS 7.1 came out. Now on any removeFromSuperview method, crash. For example: I got view controllers, and when I want to remove a view controller, I remove all of its subviews, and then remove from the stack (stack: I'm storing view controllers in this, for load new contents, and load previous contents): for (UIView *subView in [contentVc subviews]) [subView removeFromSuperview]; And I got -[CALayer retain]: message sent to deallocated instance message [actual removeFromParentViewController]; is a good way to remove it? And will it release the whole view

Accessing a Top Navigation Controller from a Subview Navigation Controller

左心房为你撑大大i 提交于 2019-12-03 00:36:24
I have a my views and controllers set up like so. A Tab/Bar controller Within 1. is a root view controller within 2. is a programmatically created navigation controller, that is displayed as a subview in the root view controller. What I am trying to do is access the top tab bar/navigation controller so that i can push a view onto it. I tried parentViewController but all it did was push the view onto the programmed nav controller. any suggestions? This is how i set up my root view controller: -(void)viewDidAppear:(BOOL)animated{ NSLog(@"ROOT APPEARED"); [super viewDidAppear:animated];

Mix HTML and JSF in a JSF subview

我怕爱的太早我们不能终老 提交于 2019-12-02 22:26:07
问题 The problem I have today is about dealing with HTML in an included JSP, with JSF. So here's the situation : I use JSF 1.2 by IBM on RAD with Websphere v6.1 I have a custom component (from the company layer) to use tabs. And in order to have a cleaner code, I just want to separate the JSF code of each tab in a separated JSP, this way, main.jsp : <customTag:tabComponent> <jsp:include page="/jsp/workflow/tab1.jsp"></jsp:include> <div align="right"> <customTag:switchToTab title="Next" tabValue="2

How to remove subviews in Objective-C?

廉价感情. 提交于 2019-12-02 21:16:59
I have added UIButton and UITextView as subviews to my view programmatically. 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.view addSubview:textView]; printf("\n description button \n"); button = [UIButton buttonWithType:UIButtonTypeRoundedRect]; [button addTarget:self action:@selector(cancel:) forControlEvents:UIControlEventTouchDown]; [button setTitle:@"OK" forState

Add subview using storyboard without external xib

亡梦爱人 提交于 2019-12-02 19:20:22
I'm learning Objective-C. I have a problem with new storyboard feature. I would initialize a subview inside a main view with xib. Without using storyboard, I could do it using: controller = [[UIViewController alloc]initWithNibName:@"NibName" bundle:nil]; [self.view addSubview:controller.view]; Now, I wouldn't use an external xib, but I want manage a view in a class and use it like a subview in another class. I know that is possible use a xib and use a similiar code to load it, but it must be out the storyboard. django-d First create the view in your storyboard and then instantiate it with the

What is the correct way to remove a subview from a view hierarchy and nuke it?

我的未来我决定 提交于 2019-12-02 17:26:53
I have a parent UIView with a number of subviews. Periodically I need to remove a subview and completely remove it from the system. What is the correct way to do this? I tried this: UIView *v = [self.containerView viewWithTag:[n integerValue]]; [v removeFromSuperview]; and got a bizarre result. Previously present UIView s disappeared as well. What's going on? Try this: UIView *v = [self.containerView viewWithTag:[n integerValue]]; v.hidden = YES; [self.containerView bringSubviewToFront:v]; [v removeFromSuperview]; Another thing I just noticed from the UIView class document - see the last

iOS prevent subview of tableview from scrolling with tableview

有些话、适合烂在心里 提交于 2019-12-02 11:14:25
问题 I have added a subview to my tableview and when ever the user scrolls the tableview, the subview scrolls with it. How do I prevent this? I know it's probably along the lines of not adding the view to the tableview's subviews, but I have no knowledge of any other ways to do this. Thanks. 回答1: If you want to make a view a subview of the table view, then you can make it floating (non-scrolling) by changing its origin.y value in the scrollViewDidScroll method. -(void)scrollViewDidScroll:

What's the best way to update an image in my tableview image subview?

断了今生、忘了曾经 提交于 2019-12-02 09:48:34
Specifically, how do you get the image subview from a uitableview cell? My table view gets data from the web asynchronously. When I created the image view the first time, I added the view by: [imageView setImage:image]; [cell addSubview:imageView]; in tableView:cellForRowAtIndexPath: . After new data is retrieved, I call reloadData to refresh the table view. But to update the image, I'd like to get a handle of this imageView (if it exist) and update the image. My question is: Given the cell, is there a way to get this image view (handle) directly , or do I have to loop through the subviews to