Center ImageView in TableViewCell

Discussion in 'iOS Programming' started by mikezang, Apr 18, 2012.

  1. mikezang macrumors 6502a

    Joined:
    May 22, 2010
    Location:
    Tokyo, Japan
    #1
    I want to show image on the center of cell using ImageView in TableViewCell, is it possible?
     
  2. jnoxx macrumors 65816

    jnoxx

    Joined:
    Dec 29, 2010
    Location:
    Aartselaar // Antwerp // Belgium
    #2
    Not standard UITableViewCell, you can easily create your own by subclassing UITableViewCell, and load that instead of UITableViewCell *blah;
     
  3. mikezang thread starter macrumors 6502a

    Joined:
    May 22, 2010
    Location:
    Tokyo, Japan
    #3
    So only custom cell can do it?
     
  4. jnoxx macrumors 65816

    jnoxx

    Joined:
    Dec 29, 2010
    Location:
    Aartselaar // Antwerp // Belgium
    #4
    If you check the official documentation , you will see nothing standard will fit your needs, or you add an image and center it on the view, but you cn't really manipulate the rest, but to be easy, and just, neat coding, create a custom cell :)
     
  5. mikezang thread starter macrumors 6502a

    Joined:
    May 22, 2010
    Location:
    Tokyo, Japan
  6. nathanlloyd macrumors member

    Joined:
    Dec 7, 2009
    Location:
    UK
    #6
    Just out of interest would you create your custom cell as a nib in Interface Builder or code it all?
     
  7. mikezang thread starter macrumors 6502a

    Joined:
    May 22, 2010
    Location:
    Tokyo, Japan
  8. jnoxx macrumors 65816

    jnoxx

    Joined:
    Dec 29, 2010
    Location:
    Aartselaar // Antwerp // Belgium
    #8
    Depends on the complication of the Cell.. But mostly I just go for the code, I just use the same code for iPad/iPhone, can do that with nibs too, but code is still faster as NIBs, even though you won't see it with the naked eye, but i like how everything just counts to speed the app up.
     
  9. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #9
    Are you saying a hand-coded custom cell is significantly faster than a NIB-based one?
     
  10. jnoxx macrumors 65816

    jnoxx

    Joined:
    Dec 29, 2010
    Location:
    Aartselaar // Antwerp // Belgium
    #10
    I did some testing back in the days with massive rerendering of cells, and i had a slight faster rate with the custom made ones.
    Not sure if it was just strange luck, i'm glad to listen to anything that could go against that. People are asking me all the time what is faster, NIB's vs hand coded views.
    The amount of developing ofcourse is alot higher with Handcoded, but is processing XML (which NIB's are like you will know Dejo) + compiling the code faster then just coding it all the way?
    I'm glad to hear about this (since it's something i'm constantly looking for too).
     

Share This Page