SORU
12 Mayıs 2010, ÇARŞAMBA


Bu UİTableView bölümleri arasındaki boşluğu azaltma

Bir şekilde bir UİTableView iki bölüm arasındaki boşluğu azaltmak için var mı? Ben her bölüm arasında yaklaşık 15 piksel vardır. Zaten -tableView:heightForFooterInSection: -tableView:heightForHeaderInSection: 0 iade etmeye çalıştım ama bu hiçbir şeyi değiştirmez.

Herhangi bir öneriniz var mı?

CEVAP
12 EYLÜL 2011, PAZARTESİ


0 mesafeyi daraltmak isteyen herkes için kullanmak zorunda:

tableView.sectionHeaderHeight = 0.0;
tableView.sectionFooterHeight = 0.0;

Bu UİTableViewDelegate hizmet bir etkisi yüzer sıfırdan başlayarak yapar sadece.

-(CGFloat)tableView:(UITableView*)tableView heightForHeaderInSection:(NSInteger)section
{
    return 1.0;
}


-(CGFloat)tableView:(UITableView*)tableView heightForFooterInSection:(NSInteger)section
{
    return 1.0;
}

-(UIView*)tableView:(UITableView*)tableView viewForHeaderInSection:(NSInteger)section
{
    return [[[UIView alloc] initWithFrame:CGRectZero] autorelease];
}

-(UIView*)tableView:(UITableView*)tableView viewForFooterInSection:(NSInteger)section
{
    return [[[UIView alloc] initWithFrame:CGRectZero] autorelease];
}

(böyle büyük mükafat 4.0.2 ile iOS 4.1 kullanarak)

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • Bart Baker

    Bart Baker

    1 Aralık 2006
  • esnathesinger

    esnathesinge

    6 NİSAN 2009
  • expertvillage

    expertvillag

    5 NİSAN 2006