ContactPicker
Definition
A button that, when clicked on, displays a list of the contacts to choose among. After the user has made a selection, the following properties will be set to information about the chosen contact:
ContactName
: the contact’s nameEmailAddress
: the contact’s primary email addressEmailAddressList
: a list of the contact’s email addressesContactUri
: the contact’s URI on the devicePhoneNumber
: the contact’s primary phone number (on Later Android Verisons)PhoneNumberList
: a list of the contact’s phone numbers (on Later Android Versions)Picture
: the name of the file containing the contact’s image, which can be used as a Picture property value for the Image or ImageSprite component.
Other properties affect the appearance of the button (TextAlignment
, BackgroundColor
, etc.) and whether it can be clicked on (Enabled
).
The ContactPicker
component might not work on all phones. For example, on Android systems before system 3.0, it cannot pick phone numbers, and the list of email addresses will contain only one email.
Properties
- BackgroundColor
- Specifies the
ContactPicker
’s background color as an alpha-red-green-blue integer. If anImage
has been set, the color change will not be visible until theImage
is removed. - ContactName
- Returns the full name of the selected contact, or the empty string if a name is unavailable.
- ContactUri
- Returns a URI that specifies the location of the contact on the device.
- EmailAddress
- Returns the primary email address of the selected contact, or the empty string if an email address is unavailable.
- EmailAddressList
- Returns a list of email addresses associated with the selected contact.
- Enabled
- Specifies whether the
ContactPicker
should be active and clickable. - FontBold
- Specifies whether the text of the
ContactPicker
should be bold. Some fonts do not support bold. - FontItalic
- Specifies whether the text of the
ContactPicker
should be italic. Some fonts do not support italic. - FontSize
- Specifies the text font size of the
ContactPicker
, measured in sp(scale-independent pixels). - FontTypeface
- Specifies the text font face of the
ContactPicker
as default, serif, sans serif, or monospace. - Height
- Specifies the
ContactPicker
’s vertical height, measured in pixels. - HeightPercent
- Specifies the
ContactPicker
’s vertical height as a percentage of theScreen
’sHeight
. - Image
- Specifies the path of the
ContactPicker
’s image. If there is both anImage
and aBackgroundColor
specified, only theImage
will be visible. - PhoneNumber
- Returns the primary phone number associated with the selected contact, or the empty string if no phone number is associated with the contact.
- PhoneNumberList
- Returns a list of phone numbers associated with the selected contact.
- Picture
- Returns a picture URI for the selected contact, which can be used to retrieve the contact’s photo and other fields.
- Shape
- Specifies the shape of the
ContactPicker
. The valid values for this property are0
(default),1
(rounded),2
(rectangle), and3
(oval). TheShape
will not be visible if anImage
is used. - ShowFeedback
- Specifies if a visual feedback should be shown when a
ContactPicker
with an assignedImage
is pressed. - Text
- Specifies the text displayed by the
ContactPicker
. - TextAlignment
- Specifies the alignment of the
ContactPicker
’s text. Valid values are:0
(normal; e.g., left-justified if text is written left to right),1
(center), or2
(opposite; e.g., right-justified if text is written left to right). - TextColor
- Specifies the text color of the
ContactPicker
as an alpha-red-green-blue integer. - Visible
- Specifies whether the
ContactPicker
should be visible on the screen. Value istrue
if theContactPicker
is showing andfalse
if hidden. - Width
- Specifies the horizontal width of the
ContactPicker
, measured in pixels. - WidthPercent
- Specifies the horizontal width of the
ContactPicker
as a percentage of theScreen
’sWidth
.