Tag: uitableview

UITableView slightly goes up when keyboard hides

I am using UITableView (chatTable) along with UITabBar (chatTabBar) and one textField inside imageView. I am using autolayout. I used the following code to change the views when keyboard appears and disappears. – (void)keyboardWasShown:(NSNotification*)aNotification { NSDictionary* info = [aNotification userInfo]; // get animation info from userInfo NSTimeInterval animationDuration; CGRect keyboardFrame; [[info objectForKey:UIKeyboardAnimationDurationUserInfoKey] getValue:&animationDuration]; [[info objectForKey:UIKeyboardFrameBeginUserInfoKey] […]

UITableViewCell subclass

I have this code segment: if (cell == nil) { CGRect cellFrame = CGRectMake(0,0,300,250); cell = [[UITableViewCell alloc] initWithFrame:cellFrame reuseIdentifier:CellTableIndetifier]; CGRect nameLabelRect = CGRectMake(0, 5, 70, 20); UILabel* nameLabel = [[UILabel alloc] initWithFrame:nameLabelRect]; nameLabel.textAlignment = NSTextAlignmentCenter; nameLabel.text = @”Name”; nameLabel.font = [UIFont boldSystemFontOfSize:12]; [cell.contentView addSubview: nameLabel]; CGRect colorLabelRect = CGRectMake(0, 25, 70, 20); UILabel* colorLabel […]

how to use UItableViewCell reuseIdentifier

I want to use UITableviewCell reuse,I have a custom UITableViewCell and using ARC,my UITableViewCell is different . my code is: – (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { PostCount *post=[listArr objectAtIndex:indexPath.row]; static NSString *CellIdentifier = @”TimeLineViewCell”; TimeLineViewCell *cell = (TimeLineViewCell*)[tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if(cell==nil){ cell = [[TimeLineViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@”CellIdentifier11″]; } cell.tag=indexPath.row+1000; cell.lab_time.text=[ModelClass intervalSinceNow:post.when btime:0]; cell.delegate=self; [cell setViewStyle:post]; […]

Radio button logic in UItableViewCells

Hey I’m working on a screen where user have option groups for example “Drink” which is title of section in my tableView, and their choices are “7up”, “coke”, etc which are cells of my table. Now every Option Group choice (every cell in order words) has one radio button. I want to implement this. I’m […]

UIButton inside UITableViewController

I have a UIButton that is created inside of each table cell. I want to hook up a touch event like so: [imageButton addTarget:self action:@selector(startVote:) forControlEvents:UIControlEventTouchUpInside]; I want to pass data about the current row (the id of the object for that row) to the startVote method. Is there a method that I am missing […]

manually add UITabBar to UITableViewController

I have a standard app with a navigation controller managing several UITableViewController classes. I want to add a UITabBar to the root view (a UITableViewController) to manage filtering the selection of objects showin in the UITableView. I dont want/need a UITabBarController. The UITabBar is only for functionality and UI (radio-button style selection and familiar tabbar […]

UITableView cell contents not displayed properly

I use auto layout and want to display UITableView with custom cell that has a UITextView with variable content. Cells are displayed as shown below. For chat message, when cell is first displayed only 2-3 characters are displayed in a single line and next characters are forced to go to next line. But when I […]

Best approach for a UICollectionView to look like the iOS calendar app

I’m building an app where I really need to display a list like the one seen in the iOS calendar app. I need to create a collectionView where I can have cells that expand enough to cover their respective hours, like so: I’ve tried various things, including this project at Github which I didn’t understand […]

UITableViewCell + Autolayout + RTL

I’m localising my app to Hebrew, which is an RTL language. Each cell has horizontal constraints set as Leading/Trailing which are automatically reversed on RTL languages. The final result is exactly as expected, but when scrolling through the table view, the UITableViewCell subviews are animating from LTR to RTL, which is very weird. Is there […]

Slide UITableViewCell

My goal is to have a UITableViewCell slide off one side of the screen (like in Twitter) and then slide back on from the other side. I’m able to make the cell slide off the screen to the right, but I can’t seem to figure out how to get it to slide back onto the […]