CometChatListItem contains one to three lines of text optionally flanked by icons or other views, such as CometChatAvatar, CometChatDate or Text. CometChatAvatar will always be shown in the leading view therefore either one among the avatarURL or avatarName must be provided. The icons (or other widgets) for the list item are defined with the tailView parameter. The first line of text is optional and is specified with title. The value of subtitle is also optional, will occupy the space allocated for an additional line of text or some other view.
Methods
Set Avatar
| Method | Description |
|---|---|
| set(avatarURL: String) | Sets the avatarURL to display image |
| set(avatarName: String) | Sets the avatar name to show initials |
- Swift
Set Avatar Style
User can style the avatar component in list item with the help of properties provided by theAvatarStyle.
| Method | Description |
|---|---|
set(background: UIColor) | Sets the background color for Avatar |
set(cornerRadius: CometChatCornerStyle) | Sets the corner radius for Avatar |
set(borderWidth: CGFloat) | Sets the border width for Avatar |
set(borderColor: UIColor) | Sets the border color for Avatar |
set(textFont: UIFont) | Sets the text font for Avatar |
set(textColor: UIColor) | Sets the text color for Avatar |
set(outerViewWidth: CGFloat) | Sets the outerView width for Avatar |
set(outerViewSpacing: CGFloat) | Sets the outerView spacing for Avatar |
- Swift
Set StatusIndicator Style
User can style the status indicator component in list item with the help of properties provided by theStatusIndicatorStyle.
| Method | Description |
|---|---|
set(statusIndicatorIcon: UIImage) | Sets the icon for status indicator in list item |
hide(statusIndicator: Bool) | Hide/shows the status indicator in list item |
set(background: UIColor) | Sets the background color for status indicator in list item |
set(cornerRadius: CometChatCornerStyle) | Sets the corner radius for status indicator in list item |
set(borderWidth: CGFloat) | Sets the border width for status indicator in list item |
set(borderColor: UIColor) | Sets the border color for status indicator in list item |
- Swift
Background
The background is a UIView which is present in the backdrop forListItem. You can modify the background using the below methods:
| Method | Description |
|---|---|
set(background: [UIColor]) | Sets the title font for ConversationListItem |
- Swift
Set Title
The title is aUILabel which specifies a title for ListItem. You can modify the title using the below methods:
| Method | Description |
|---|---|
set(title: String) | Sets the title for list item. |
- Swift
Set Subtitle View
The SubTitleView is a UIView that specifies a subTitle forListItem. You can modify the title using the below methods:
| Method | Description |
|---|---|
| set(subtitle: UIView) | Sets the subtitle view for ListItem. |
- Swift
Set Tail View
The TailView is a UIView that specifies a tail forListItem. You can modify the title using the below methods:
| Method | Description |
|---|---|
set(tail: UIView) | Sets the tail view for ListItem. |
- Swift
Set Custom View
The custom view is a UIView that specifies a tail forListItem. You can modify the title using the below methods:
| Method | Description |
|---|---|
set(customView: UIView) | Sets the custom view for ListItem. |
- Swift
Set ListItem Style
User can style the list item with the help of properties provided by the ListItemStyle.| Method | Description |
|---|---|
set(background: UIColor) | Sets the background color for ListItem |
set(cornerRadius: CometChatCornerStyle) | Sets the corner radius for ListItem |
set(borderWidth: CGFloat) | Sets the border width for ListItem |
set(borderColor: UIColor) | Sets the border color for ListItem |
set(titleColor: UIColor) | Sets the title color for ListItem |
set(titleFont: UIFont) | Sets the title font for ListItem |
- Swift
Allow Selection
This enables the selection mode for list item| Method | Description |
|---|---|
allow(selection: Bool) | Sets the selection mode for ListItem. |
- Swift