Help Center/ Meeting/ Client SDK Reference/ macOS SDK/ APIs/ UI Customization/ Setting the Profile Picture Style
Updated on 2025-05-29 GMT+08:00

Setting the Profile Picture Style

setParticipantAvatarStyle:

API Description

This API is used to set the profile picture style of participants.

Precautions

  1. This API is optional. If it is not called, the default profile picture style is used.

Method Definition

- (HWMSDKERR)setAvatarStyle:(HWMUISDKAvatarStyleModel *)avatarStyle;

Parameter Description

Table 1 HWMUISDKAvatarStyleModel description

Parameter

Mandatory

Type

Description

backgroundColor

Yes

NSString *

Background color.

textColor

Yes

NSString *

Text color.

nameShowType

Yes

HWMUISDKNameShowType

Name display style.

avatarShape

Yes

HWMUISDKAvatarShape

Profile picture shape.

phoneIconPath

Yes

NSString *

Path of the mobile phone icon.

boardIconPath

Yes

NSString *

Path of the large display icon.

Table 2 Enumerated values of HWMUISDKNameShowType

Enumerated Value

Description

HWMUISDKFirstLetter

For a Chinese name, the first letter in pinyin is displayed. For an English name, the first letter is displayed.

HWMUISDKFamilyName

For a Chinese name, the family name is displayed. For an English name, the first letter is displayed.

Table 3 Enumerated values of HWMUISDKAvatarShape

Enumerated Value

Description

HWMUISDKCircle

Circle.

Return Values

Whether the API is successfully called.

Sample Code

/// Set the profile picture style.
- (void)customAvatarStyle {
   HWMUISDKAvatarStyleModel *style = [[HWMUISDKAvatarStyleModel alloc] init];
   style.backgroundColor = this.getBackgrounColor();
   style.textColor = this.getTextColor();
   style.nameShowType = this.getNameShowType();
   style.avatarShape = this.getAvatarShaoe();
   style.phoneIconPath = this.getPhoneIconPath();
   style.boardIconPath = this.getBoardIconPath();
   HWMSDKERR result = [[HWMBizSdk getBizOpenApi] setAvatarStyle:self.avatarStyleModel];
}