UITableView background showing in Interface Builder but in simulator - uitableview

does anyone know why, if I add an image UIImage as background, I can clearly see it behind my grouped table view in Interface Builder.
However when I launch the app, the background is not showing at all, both in simulator and device.
Apart from adding the image, I suppose I already did all the steps at TableView programmatic side:
self.tableView.backgroundColor = [UIColor clearColor];
self.tableView.opaque = NO;
self.tableView.backgroundView = nil;
thanks

Following a post I made, I found two possible solutions, one with UIViewController in place of UITableVIewController as discussed here:
UITableView with fixed image background
with a disadvantage of header and footer problem with grouped table.
The other solution, involves writing more code and could be the case only if you have a common table that you share within different views of the apps: basically is to have a UIViewController calling a UITableViewController and attach its subview to self.view.

Related

Change Anypic Assets

When changing the assets in the Parse Anypic tutorial it doesn't show up in the actual simulator. The files I changed are in the Resources folder: Default.png, Default#2x.png, Default-568h#2x.png, Default-667h#2x.png, Default-736h#2x.png
For more clarification this is a picture of the files I changed.
https://www.dropbox.com/s/cjml6hs2aur9z96/Screenshot%202015-04-21%2017.09.13.png?dl=0
Question: How can I change the black "Home" screen - not the LaunchImage but the actual interaction. I want to re-skin the app.
For clarity, I'm referring to the first screen you see after logging into Facebook. This screen has three tabs at the bottom, "Home", "Camera", and "Activity". The "Home" view is controlled by PAPHomeViewController.m, and the "Activity" view is controlled by PAPActivityFeedViewController.m.
In both of these controller classes, the main background is covered by a table view and there is also a blankTimelineView that can be shown as the table view header.
To update the background, you can have a couple of options. Option 1 is to change the view behind the table view and make the table view transparent. Option 2 is to change the background on the table view itself.
In both cases, you may also want to make the blankTimelineView background transparent so the background always shows through.
If you go with Option 1, the following code can be placed at the bottom of the viewDidLoad method in PAPHomeViewController.m and in PAPActivityFeedViewController.m
// For simple change, set background color
// To show an image, add an UIImageView as a subview
self.view.backgroundColor = [UIColor redColor];
// Make sure background shows through
self.blankTimelineView.backgroundColor = [UIColor clearColor];
self.tableView.backgroundView.backgroundColor = [UIColor clearColor];
If you go with Option 2, you can use the following code at the bottom of the viewDidLoad method in PAPHomeViewController.m and in PAPActivityFeedViewController.m
// For simple change, set background color
// To show an image, set backgroundView to a UIImageView
self.tableView.backgroundView.backgroundColor = [UIColor redColor];
// Make sure background shows through
self.blankTimelineView.backgroundColor = [UIColor clearColor];
If you aren't getting the assets changed maybe run it on an actual phone. Check to see if the assets show up or not based on your result choose between starting over and importing all your code or retrieve the assets from another project and import it to your old project

How to make a transparent tableview?

im trying to make a menu like FIFA app but i can't put the tableview in a transparent color,so the background image can be visible, can anyone help me?? I've tried of everything, any of this answers worked for me: UITableView clear background so i really need your help.
In addition to setting the background color of the table view to clear, you have to set the background color of the table view cells. And that, at least in my experience, has been somewhat tricky and couldn't be easily done via Interface Builder (the storyboard or the xib).
So you have to set the background color on your cells directly. For example, during your tableView:willDisplayCell:forRowAtIndexPath: delegate method, you'd do something like:
cell.backgroundColor = [UIColor clearColor];
And as rmaddy points out, Apple documentation for that method states:
This method gives the delegate a chance to override state-based
properties set earlier by the table view, such as selection and
background color.

Set TableView SeperatorStyle to SingleLineEtched dont work

i tied to set the Seperator Style of my UITableView to SingleLineEtched, but it didn´t work. First i tried to set it in my Interface Builder, as you can see i set the Table Style to "Grouped":
But then my TableView don't show any seperate Lines..nothing....
So i tried it programmatically with:
[self.tableView setSeparatorStyle:UITableViewCellSeparatorStyleSingleLineEtched];
self.tableView.backgroundColor = [UIColor grayColor];
but that also don´t work.
Some Ideas what i´m doing wrong?
try using it in device, as per this post the problem here lay in the iPhone Simulator itself

Set an image as background for TableView with Storyboard in iOS

Storyboard is causing to me a lot of problems! :(
Now I'm trying to put an image as a background of a tableview in iOS.
I've done a png image with transparency in photoshop and I've imported it into my project.
** The first question is: is it possible to set the image background in storyboard?
I thought that a good idea was to create and image view and put it on my table view... but storyboard doesn't allow my to do this.
** I've also tried to add the background image via code:
- (void)viewDidLoad
{
[super viewDidLoad];
self.tableView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:#"table_background.png"]];
...
}
I obtained an horrible result with a black background instead of white, even if the png is transparent!
Moreover I've read that to optimize performances, it should be better to avoid transparent background for cells.
So, what it the best way to set an image as a background for a table view with storyboard?
Thank you in advance,
yassa
I think you have a method to set a background view for a tableView
[ tableView setBackgroundView:<#(UIView *)#> ];
And then add an UIImageView (but only for 3.2+)
Avoid using backgroundColor for this kind of things ^^
Using only story board I don't know :-] but with this method it should work.
Btw check that your tableView & cell have a clear backgroundColor, may be the problem too.
Good luck.

iOS: Using modal pageFlip makes strange cell animation in UITableViewController

I wanted to show a Settings view, so I figured I could use the pageCurl modal style. I have a UIViewController that I am presenting from:
Settings *settings = [[[Settings alloc] initWithStyle:UITableViewStyleGrouped] autorelease];
settings.view.backgroundColor = [UIColor scrollViewTexturedBackgroundColor];
settings.modalTransitionStyle = UIModalTransitionStylePartialCurl;
settings.modalPresentationStyle = UIModalPresentationFullScreen;
[self presentModalViewController:settings animated:YES];
When the page curls, to reveal my UITableViewController below, the cells subviews (labels and accessory views) seem to animate into position, which looks horrible:
The strange thing is, is that the animation never happens to the top cell in a section. This does not happen with other modalTransitionStyle's so I am wondering why this could be happening. It is really becoming frustrating because I cannot figure out how to stop this from happening.
Ideas?
If you set the autoResizingMask property of the tableView to UIViewAutoresizingNone, I think this won't happen. This may be a little bug in the page curl animation.
I've noticed that the direction of this weird animation (which also happens to UIButtons), depends on the Alignment chosen in the Control section of the object's Attributes inspector (in Interface Builder). I've been tinkering with all attributes all evening and have found no solution yet. :(
Edit: so, I had three UIButton in my view (and one UIPickerView) that where doing this weird behavior at the same time. I created a property linking to ONE of the UIButtons. Then, in the viewDidLoad of this view's controller I added the following line:
_firstAffectedButton.titleLabel.autoresizingMask = UIViewAutoresizingNone;
And that fixed it for me, for all the buttons and the picker!! :? Weird, right?
Can anyone explain why this is working? I have the feeling I'm doing something stupid to fix this, but I can't see what it is.
Edit 2: Turns out there was a better and cleaner solution to this problem. See this post.

Resources