Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 09-03-2011, 12:56 PM   #1 (permalink)
Registered Member
 
Join Date: May 2009
Posts: 14
macintosh264 is on a distinguished road
Question Resize table view

Okay, so I have a problem. I want to do the following:
- Resize a table view so that I have 20 empty pixels above the table view and the navigation item
- Add a small view in said space
- Give that view a sky blue background color
- Have news feed like text in that view

I can figure out the news feed thing myself and the sky blue thing, but how can I resize the table view. I have tried just setting the frame when the view loads, but nothing happens.
Code:
- (void)setupView {
//called on viewDidLoad
    CGRect tabViewBds = self.tableView.frame;
    int removeSize = 20;
    self.tableView.frame = CGRectMake(tabViewBds.origin.x, tabViewBds.origin.y+removeSize, tabViewBds.size.width, tabViewBds.size.height);
}
So can you help me?
macintosh264 is offline   Reply With Quote
Old 09-03-2011, 04:01 PM   #2 (permalink)
Cocoa Junkie
 
Duncan C's Avatar
 
Join Date: Dec 2008
Location: Northern Virginia
Posts: 6,003
Duncan C has a spectacular aura about
Default

Quote:
Originally Posted by macintosh264 View Post
Okay, so I have a problem. I want to do the following:
- Resize a table view so that I have 20 empty pixels above the table view and the navigation item
- Add a small view in said space
- Give that view a sky blue background color
- Have news feed like text in that view

I can figure out the news feed thing myself and the sky blue thing, but how can I resize the table view. I have tried just setting the frame when the view loads, but nothing happens.
Code:
- (void)setupView {
//called on viewDidLoad
    CGRect tabViewBds = self.tableView.frame;
    int removeSize = 20;
    self.tableView.frame = CGRectMake(tabViewBds.origin.x, tabViewBds.origin.y+removeSize, tabViewBds.size.width, tabViewBds.size.height);
}
So can you help me?

It sounds like you want to have your table view take up part of the screen, and have a separate view with a sky blue background and a news feed. In that case, just set up your view controller with a table view that's smaller than the whole size of the screen, and place your "blue view" above it.
__________________
Regards,

Duncan C
WareTo

Check out our apps in the Apple App store


Check out this password generator app that shows various techniques including using a data container singleton object to share data between objects in your project.

See this tutorial on using UIView animations and layer animations:

See this thread on generating random, non-repeating text

Check out a very cool Macintosh Kaleidoscopes app called ScopeWorks that we released to the Mac App store.
Duncan C is offline   Reply With Quote
Old 09-03-2011, 05:59 PM   #3 (permalink)
Registered Member
 
Join Date: May 2009
Posts: 14
macintosh264 is on a distinguished road
Default

Quote:
Originally Posted by Duncan C View Post
It sounds like you want to have your table view take up part of the screen, and have a separate view with a sky blue background and a news feed. In that case, just set up your view controller with a table view that's smaller than the whole size of the screen, and place your "blue view" above it.
Thanks! I'll try that out.
macintosh264 is offline   Reply With Quote
Reply

Bookmarks

Tags
cgrect, frame, resize, table view

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 387
5 members and 382 guests
JackReidy, jeroenkeij, Sami Gh, yomo710
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,671
Threads: 94,121
Posts: 402,903
Top Poster: BrianSlick (7,990)
Welcome to our newest member, JackReidy
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 04:50 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0