Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 510 Vote(s) - 3.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Adding the little arrow to the right side of a cell in an iPhone TableView Cell

#1
This should be simple enough.

I have an iPhone app with a TableView. How do I add the little classic arrow to the righthand side of each cell?
Reply

#2
Use the `accessoryType` property of the cell to show a arrow on the right side. See [this][1].

[1]:

[To see links please register here]

Reply

#3
for simple arrow:

cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;


and for detailed arrow:

cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton;
Reply

#4
The other way to do this is to specify `UITableViewCellAccessoryDisclosureIndicator` when you create the cell. To do this you'll likely alloc init your cell in the tableViewCellWithReuseIdentifier delegate method (then proceed to customize and configure your cell).

UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellAccessoryDisclosureIndicator reuseIdentifier:identifier];
Reply

#5
You can set little classic arrow like two way as below

1) Using inbuilt accessory type method of UITableViewCell

[cell setAccessoryType:UITableViewCellAccessoryDisclosureIndicator];

2) Creating own accessory view with own image

(I) Drag & drop an arrow image(i.e. circle_arrow_right.png) in your project

(II) In cell design method for every row as below

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath

Write below code:

if (cell ==nil) {
cell=[[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]autorelease];

//For creating custom accessory view with own image
UIImageView *accessoryView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 30, 30)];
[accessoryView setImage:[UIImage imageNamed:@"circle_arrow_right.png"]];
[cell setAccessoryView:accessoryView];
[accessoryView release];

//Your other components on cells
.............
.............

}

[**Note:** Choose appropriate images for accessory view and add in your desired cells. Choose small images for accessory views for better performance.]

Reply

#6
You can do this in Interface Builder. Simply click click on the **Table View**, go to **Prototype Cells** on the right side and make it 1. Then click that **Prototype Cell** and on the right look for **Accessory**. In the drop-down, click **Disclosure Indicator**.

![Interface Builder example][1]


[1]:
Reply

#7
**Swift 3:**

cell.accessoryType = .disclosureIndicator
Reply

#8
Best way is select `Disclosure Indicator` in `Accessory` section.
Reply

#9
Just set the respective ***accessoryType*** property of *UITableViewCell*.

cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;

In **Swift 3**,

cell.accessoryType = .disclosureIndicator

Reply

#10
IN SWIFT 5
----------

Use

cell.accessoryType = .detailButton
for a small Info-button on the right.
[![enter image description here][1]][1]

cell.accessoryType = .disclosureIndicator
for a small Info-arrow on the right.
[![enter image description here][2]][2]

cell.accessoryType = .detailDisclosureButton
for a small Info-button and Info-arrow on the right.
[![enter image description here][3]][3]

infront of your `return cell`


[1]:

[2]:

[3]:
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through