UItableview each cell label want to hide and height should be change

saravanar

enter image description here

Create tableview and design it in CustomTableCell Name,code,continent,population line etc. and got the values from web web services united states,usa,989898,north America etc. In CustomTableCell design it. my problem name should be a canada means code and continent want to hide and display population:979797 and height should be reduse. next mexico means want to display all values.china and afghanistan values should be code, continent hide. Population: Want to display. how is possible help.(My doubt: In tableview cell create a one label it display in all cell how to hide and display in each cell).help me. what want to do in cellforrow in heighforrow .Ple see the screen here.than Advance.

Deepraj Chowrasia

Yes,it is possible.You have to apply condition based on the country name in the method cellForRowAtIndexPath. Like this

if(countryName isEqualToString @"Canada"){
     countryInfoLabel.numberofLines=0;
     countryInfoLabel.text=[NSString stringWithFormat:@"Population:%@",populationFromService]];
}

Insert the information in the label countryInfoLabel based on the country name and display it accordingly. use \n to move to next line in countryInfoLabel.

And to change the height of the cell dynamically use the heightForRowAtIndexPath Use the following code

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
   return (countryName.frame.origin.height+countryInfoLabel.frame.origin.height);
}

Hope it will work.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Hide label when UITableView Cell is tapped

From Dev

Change label height of custom cell within didSelectRowAtIndexPath

From Dev

How to change cell height dynamically in UITableView static cell

From Dev

Get UITableView cell height

From Dev

Uitableview cell dynamic height

From Dev

UITableView: How to change cell height dynamically when a button is clicked in it?

From Dev

UITableView: How to change cell height dynamically when a button is clicked in it? Swift

From Dev

Hide UITableview cell

From Dev

Hide ' > ' in the UITableView Cell

From Dev

UITableView with UIWebView in each cell

From Dev

Swift - UITableview: How to make a tap on one cell cause change a label in another cell?

From Dev

UITableview heightForRowAtIndexPath: reloads label in cell

From Dev

UITableview heightForRowAtIndexPath: reloads label in cell

From Dev

UITableView cell icon and label are misplaced

From Dev

UITabBar will hide the last cell of the UITableView

From Dev

cell height depending on a label text

From Dev

cell height depending on a label text

From Dev

Change cell height but not elements in it

From Dev

UItableView with static cells contains 2 UItableviews each with custom cell with dynamic height

From Dev

Xamarin.iOS iOS 8 UITableView custom cell height does not change

From Dev

Xamarin.iOS iOS 8 UITableView custom cell height does not change

From Dev

iOS - dynamically change height of uitableview

From Dev

UITableView header height will not change in storyboard

From Dev

Change the UITableView's height for HeaderInSection?

From Dev

Change UIView height with respect to UITableview

From Dev

iOS - dynamically change height of uitableview

From Dev

Change slelected cell of UITableView with Swift

From Dev

UITableView - I want to display blank cell

From Dev

UITableView with variable cell height: Working in IB but not programmatically

Related Related

  1. 1

    Hide label when UITableView Cell is tapped

  2. 2

    Change label height of custom cell within didSelectRowAtIndexPath

  3. 3

    How to change cell height dynamically in UITableView static cell

  4. 4

    Get UITableView cell height

  5. 5

    Uitableview cell dynamic height

  6. 6

    UITableView: How to change cell height dynamically when a button is clicked in it?

  7. 7

    UITableView: How to change cell height dynamically when a button is clicked in it? Swift

  8. 8

    Hide UITableview cell

  9. 9

    Hide ' > ' in the UITableView Cell

  10. 10

    UITableView with UIWebView in each cell

  11. 11

    Swift - UITableview: How to make a tap on one cell cause change a label in another cell?

  12. 12

    UITableview heightForRowAtIndexPath: reloads label in cell

  13. 13

    UITableview heightForRowAtIndexPath: reloads label in cell

  14. 14

    UITableView cell icon and label are misplaced

  15. 15

    UITabBar will hide the last cell of the UITableView

  16. 16

    cell height depending on a label text

  17. 17

    cell height depending on a label text

  18. 18

    Change cell height but not elements in it

  19. 19

    UItableView with static cells contains 2 UItableviews each with custom cell with dynamic height

  20. 20

    Xamarin.iOS iOS 8 UITableView custom cell height does not change

  21. 21

    Xamarin.iOS iOS 8 UITableView custom cell height does not change

  22. 22

    iOS - dynamically change height of uitableview

  23. 23

    UITableView header height will not change in storyboard

  24. 24

    Change the UITableView's height for HeaderInSection?

  25. 25

    Change UIView height with respect to UITableview

  26. 26

    iOS - dynamically change height of uitableview

  27. 27

    Change slelected cell of UITableView with Swift

  28. 28

    UITableView - I want to display blank cell

  29. 29

    UITableView with variable cell height: Working in IB but not programmatically

HotTag

Archive