user2996143
user2996143

Reputation: 113

Autolayout iOS 7

I am working on app in which I want to show ads at bottom. I have set the auto layout constraints in storyboard for view. Now I need to show Ads at bottom and once it is shown then move other things above it.Image About view with tableviewConstraints for tableview

I want to reduce height tableview when ads appear at bottom. Please help how to achieve this with current design. Any help will be appreciated.

Upvotes: 1

Views: 172

Answers (1)

prema janoti
prema janoti

Reputation: 159

You have to add a Height constraint and adjust the size of the constraint to resize the UITableView. You can add a Height constraint in your storyboard

I prefer to set the constraint to the largest possible value and then select Less Than or Equal to allow it to shrink appropriately.

enter image description here

Next add an IBOutlet and connect it to the height constraint you just created via storyboards.

@property (weak,nonatomic) IBOutlet NSLayoutConstraint *tableHeightConstraint;

Now to resize your UITableView, modify your constraint and call needsUpdateConstraints.

self.tableHeightConstraint.constant = 200;

[self.tableView needsUpdateConstraints];

Try this Hope it will help you....

Upvotes: 1

Related Questions