Not able to resize UITableView programatically - IOS

I have added UITableView to a view, I want my application to work fine for both iPod 5th generation and lower versions(which is smaller in size), So I resized the table view height to its view height when loading, its not working, however if I resize the table in xib its working fine. What could be the problem. I suspect some property is restricting from doing this.

Pleas check the image below...

Black gap appears because of its size... Its not resizing..

I have set programatically also...

if (gui_status.device_type != OFI_VC_DVICE_TYPE_IPAD) {
        CGRect screenRect = self.table.frame;
        screenRect.size.height = 500; // with different height no change..
        [self.table setFrame:screenRect];
    }

Any helps is really appreciated. Thanx.

Answers


Rather than setting the size explicitly, when you lay out the view in the XIB, set the auto-resizing rules so that the table view has flexible width and height and static top, bottom, left and right. Now, when iOS resizes the super view (done automatically) your table view will automatically be adjusted to fit.


Need Your Help

What's the Pythonic way to implement “diamond inheritance”?

python oop inheritance

I'm facing a nearly-textbook diamond inheritance problem. The (rather artificial!) example below captures all its essential features:

How to bind multiple textbox with ViewModel array string property?

jquery .net asp.net-mvc asp.net-mvc-3 c#-4.0

In below link there is add button which allows you to ADD multiple textbox which i am using on my application.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.