开发者

how to reduce the width of table view controller

开发者 https://www.devze.com 2023-03-07 15:19 出处:网络
hii every one how dod i reduce the width of the table view cell? i am using following code to increase the height of the row ,, in the same way how can i alter width of the cell

hii every one

how dod i reduce the width of the table view cell?

i am using following code to increase the height of the row ,, in the same way how can i alter width of the cell

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath开发者_C百科 *)indexPath
{
    switch(indexPath.section)
    {
        case 0:
        {
            switch(indexPath.row)
            {
                case 0:
                {
                    return 100;
                }
                    break;

                case 1:
                {
                    return 40;
                }
                    break;

                case 2:
                {
                    return 40;
                }
                    break;

                case 3:
                {
                    return 40;
                }
                    break;

                default:
                {
                    return 15;
                }

            }
        }
            break;

}


As mentioned a cell will always have the same width, if however you wish to indent the content to show a master-detail relationship then use...

- (NSInteger)tableView:(UITableView *)tableView indentationLevelForRowAtIndexPath:(NSIndexPath *)indexPath


An UITableViewCell will always take the full width of the UITableView that is displaying the cell.

0

精彩评论

暂无评论...
验证码 换一张
取 消