2011-09-08 1 views

答えて

3

単にあなたのUITableViewCellsee here)をカスタマイズし、それが右側に表示されるように、あなたのセルのサブビューとしてカスタムUILabelを追加します。

あなたはこのUILabelはメールでのもののように見えるようにしたい場合は、このようsthgてみることとして、これは、非常に簡単です:

countLabel = [[[UILabel alloc] initWithFrame:CGRectMake(140,10,60,24)] autorelease]; 
countLabel.textColor = [UIColor whiteColor]; 
countLabel.layer.backgroundColor = [UIColor grayColor].CGColor; 
countLabel.layer.cornerRadius = countLabel.bounds.size.height/2; 
countLabel.masksToBounds = YES; 
[cell.contentView addSubview:countLabel]; 

countLabel.text = [categoryItems count]; 

(注意:UILabelのレイヤープロパティを使用します、これはあまりにも良いものです

+0

AliSoftwareありがとう!私はそれがアクセサリタイプだと思ったので、私は多くの時間を節約しました... – iosDeveloper

3

チェックアウトのGithub上TDBadgeCellライブラリを各アカウントに新規メールの#を示しました。

enter image description here

+0

)QuartzCoreフレームワークと#import <QuartzCore/QuartzCore.h>を追加することを忘れないでください!非常に簡単な要件があるので、@AliSoftwareで示された簡単なコードで作成しました。とにかくありがとう!!! – iosDeveloper

関連する問題