Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

AndyCodez

macrumors regular
Original poster
Aug 6, 2009
187
0
Basically what I am trying to do is place a subview on top of a UITableView. I have a class that adds a subview to what ever view you pass it.

Code:
[activityPopUpView startActivity:self.view]

- (void) startActivity:(UIView*) theView
{
    [theView addSubview:self.aview];
}

I have used this in the past for displaying an UIActivityView, and it worked fine. But I've needed to use this on top of a UITableView for loading information off of the interwebz. I checked the subview stack and it appears there but it will not show on top. Even with bringsubviewtofront.

Is there some weird property I am missing that will not place the subview on top of the tableview?

The code I placed earlier is just written off the top of my head its not exactly what I have, but the code has worked fine elsewhere where there is not a UITableView. My thinking is the cells are still overtop of this view and the subview I am trying to display is just covered by said cells. I have called this code in the viewdidload when the data is being brought in from the internet and parsed. which shows when there is no cells currently being displayed. But once there are cells currently being shown the subview being called will not be displayed.

The instance of the class in the viewdidload is not the same as the new instance being called after the cells are shown.

Edit: I have tried using self.table instead of self.view (self.table is the UITableView)

Please help this is driving me nuts!
 
Don't addSubview to a table view. If you want to put an activity view or something like it on top of the table addSubview the container view that's below the table view. You may need to move the view to the front of the table.

The table view is a scrollview and its contents are dynamic. There's no way to work around those things.
 
Yeah I figured as such, I was just giving it ago. I've been doing

Code:
[self.view addSubview:self.activityView];

Which was not working so i did

Code:
[self.view addSubview:self.activityView];
[self.view bringSubviewtoFront:self.activityView];

And that still doesn't work..... grr So frustrated :(
 
I just have a UIView.

EDIT: I ended up figuring out what I needed to do, run the activityView on a different thread. Doing this it worked just fine... I'll have to do some more reading on the situation but it works.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.