Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9011729
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T02:48:48+00:00 2026-06-16T02:48:48+00:00

So I’m writing some code with cocos2d and I want to do it with

  • 0

So I’m writing some code with cocos2d and I want to do it with SWTableView, problem is there is some really weird population bug with how it populates the screen vertically.

I’ll try to represent it using numbers below ex. 4 = a place where a cell can be, 4* = a cell has been placed there.

Lets say my screen right now is

1
2
3
4

After I populate it with 3 items it looks like this

1
2*
3*
4*

Basically how I created the Table has the origin at the bottom left, and not the top left which is where I want it to be. I know setVerticalFillOrder can change the order of what data is populated first, but I’ved tried both Topdown and BottopUp and both has that space at the top.

Below is how I created the Table so if anyone has any ideas it would be greatly appreciated

    CGSize winSize = [CCDirector sharedDirector].winSize;
    CGSize tableSize = CGSizeMake(table_width, table_height);

    if (_tableView) {
        [_tableView removeFromParentAndCleanup:YES];
        [_tableView release];
    }

    _tableView = [[SWTableView alloc] initWithViewSize:tableSize];
    [_tableView setDirection:SWScrollViewDirectionVertical];
    [_tableView setVerticalFillOrder:SWTableViewFillTopDown];

    [_tableView setDataSource:*my own class*];
    [_tableView setDelegate:*my own class*];

    [_tableView setPosition:CGPointMake(5, winSize.height/2-130)]; //winSize.height/2 - 160

    //refresh table
    [_tableView reloadData];

    [self addChild:_tableView];
    _tableView.isTouchEnabled = YES;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T02:48:51+00:00Added an answer on June 16, 2026 at 2:48 am

    So apparently not a lot of people seems to be using SWTableView, but I know this was a headache for me so I’ll put something here for any future people that have this kind of problem.

    I don’t know why this fixes it but create the SWTable like this

    _tableView = [SWTableView viewWithDataSource:_friendListViewController size:tableSize];
    

    This makes it populate in the correct order and from top to bottom, also note I found more issues with SWTable, if the anchor point is not at (0,0) the actual viewable size of the table shrinks, don’t know why. To fix this go into beforeDraw and increase the scaling like so

    glScissor(self.position.x, self.position.y, viewSize_.width*3, viewSize_.height*3);
    

    Finally in retina display, position and size gets messed up too, so just put a if statement to detect if its retina display, and make different position and sizes based on that.

    if ([[UIScreen mainScreen] respondsToSelector:@selector(displayLinkWithTarget:selector:)] &&
        ([UIScreen mainScreen].scale == 2.0)) {}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've tracked down a weird MySQL problem to the two different ways I was
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a jquery bug and I've been looking for hours now, I can't
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into
I want use html5's new tag to play a wav file (currently only supported

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.