IPhone : setting uilabel width acording to the length of uilabel.text that will change randomly

on Tuesday, March 31, 2015

i have a uilabel in my app and text in that uilabel is fetching from internet so text length will differ so i want to add background color to black for uilabel but i also want the width of the uilabel to change when there is small length text will fetch in it. here is my code.



cell.songtitl.text = [[rssData objectAtIndex:indexPath.row]title];


this is how i am setting text to uilabel inside cellForRowAtIndexPath. and here is my TableViewCell.h



@property (weak, nonatomic) IBOutlet UILabel *songtitl;


here is what i want to avoid by setting background color on short titles.


enter image description here


0 comments:

Post a Comment