Classe GCKUICastButton
Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
Sous-classe de UIButton qui implémente un bouton "Caster".
- Depuis
- 3.0
Hérite de UIButton.
|
BOOL | triggersDefaultCastDialog |
| Indicateur qui indique si un événement tactile sur ce bouton déclenche l'affichage de la boîte de dialogue Cast fournie par le framework. Plus
|
|
- (instancetype) initWithCoder: |
|
(NSCoder *) |
decoder |
|
- (instancetype) initWithFrame: |
|
(CGRect) |
frame |
|
- (void) setInactiveIcon: |
|
(UIImage *) |
inactiveIcon |
activeIcon: |
|
(UIImage *) |
activeIcon |
animationIcons: |
|
(NSArray< UIImage * > *) |
animationIcons |
|
|
| |
Définit les icônes pour les états actif, inactif et animé du bouton.
Les images fournies doivent être monochromes avec un arrière-plan transparent. La couleur des images n'est pas importante, car la couleur de teinte du bouton (propriété tintColor
) détermine la couleur dans laquelle elles sont affichées.
- (void) setAccessibilityLabel: |
|
(NSString *) |
label |
forCastState: |
|
(GCKCastState) |
state |
|
|
| |
Définit le libellé d'accessibilité pour les états de diffusion du bouton.
Il s'agit de la méthode recommandée pour définir le libellé d'accessibilité du bouton. Le libellé défini par setAccessibilityLabel est appliqué à tous les états de diffusion.
- (BOOL) triggersDefaultCastDialog |
|
readwritenonatomicassign |
Indicateur qui indique si un événement tactile sur ce bouton déclenche l'affichage de la boîte de dialogue Cast fournie par le framework.
Par défaut, cette propriété est définie sur YES
. Si une application souhaite gérer elle-même les événements tactiles, elle doit définir la propriété sur NO
et enregistrer une cible et une action appropriées pour l'événement tactile.
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/07/26 (UTC).
[null,null,["Dernière mise à jour le 2025/07/26 (UTC)."],[[["\u003cp\u003eThe \u003ccode\u003eGCKUICastButton\u003c/code\u003e is a subclass of \u003ccode\u003eUIButton\u003c/code\u003e that provides a pre-built "Cast" button for iOS applications.\u003c/p\u003e\n"],["\u003cp\u003eIt offers customization options for icons representing active, inactive, and animated states, ensuring visual alignment with the app's design.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can manage the button's accessibility labels to enhance usability for users with disabilities.\u003c/p\u003e\n"],["\u003cp\u003eWhile it defaults to triggering the Cast dialog, this behavior can be overridden to allow custom touch event handling within the application.\u003c/p\u003e\n"],["\u003cp\u003eThis class simplifies Cast integration by providing a ready-made UI element and handling the display of the standard Cast dialog.\u003c/p\u003e\n"]]],[],null,["# GCKUICastButton Class\n\n[Instance Methods](#pub-methods) \\| [Properties](#properties) \nGCKUICastButton Class Reference \n\nOverview\n--------\n\nA subclass of [**UIButton**](https://goo.gl/VK61wU) that implements a \"Cast\" button.\n\nSince\n: 3.0\n\nInherits UIButton.\n\n|----------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Instance Method Summary ----------------------- ||\n| (instancetype) | - [initWithCoder:](/cast/v3/reference/ios/interface_g_c_k_u_i_cast_button#a23413a39b3e6a8b12834d34c68f74445) |\n| | Constructs a new [GCKUICastButton](/cast/v3/reference/ios/interface_g_c_k_u_i_cast_button \"A subclass of UIButton that implements a \\\"Cast\\\" button. \") using the given decoder. [More...](#a23413a39b3e6a8b12834d34c68f74445) |\n| ||\n| (instancetype) | - [initWithFrame:](/cast/v3/reference/ios/interface_g_c_k_u_i_cast_button#a79e5ad64b3c53b6dbc14defda46429d3) |\n| | Constructs a new [GCKUICastButton](/cast/v3/reference/ios/interface_g_c_k_u_i_cast_button \"A subclass of UIButton that implements a \\\"Cast\\\" button. \") with the given frame. [More...](#a79e5ad64b3c53b6dbc14defda46429d3) |\n| ||\n| (void) | - [setInactiveIcon:activeIcon:animationIcons:](/cast/v3/reference/ios/interface_g_c_k_u_i_cast_button#aeb7e7925cdbcf8e553dd51bf0abcadc7) |\n| | Sets the icons for the active, inactive, and animated states of the button. [More...](#aeb7e7925cdbcf8e553dd51bf0abcadc7) |\n| ||\n| (void) | - [setAccessibilityLabel:forCastState:](/cast/v3/reference/ios/interface_g_c_k_u_i_cast_button#af6cad96ec86d102ad38a0ce3b27669d3) |\n| | Sets the accessibility label for the cast states of the button. [More...](#af6cad96ec86d102ad38a0ce3b27669d3) |\n| ||\n\n|------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Property Summary ---------------- ||\n| BOOL | [triggersDefaultCastDialog](/cast/v3/reference/ios/interface_g_c_k_u_i_cast_button#aa0f22a89c101e9d6c4b233e72ddf815c) |\n| | A flag that indicates whether a touch event on this button will trigger the display of the Cast dialog that is provided by the framework. [More...](#aa0f22a89c101e9d6c4b233e72ddf815c) |\n| ||\n\nMethod Detail\n-------------\n\n|---------------------------------|---|--------------|-----------|---|\n| - (instancetype) initWithCoder: | | (NSCoder \\*) | *decoder* | |\n\nConstructs a new [GCKUICastButton](/cast/v3/reference/ios/interface_g_c_k_u_i_cast_button \"A subclass of UIButton that implements a \\\"Cast\\\" button. \") using the given decoder. \n\n|---------------------------------|---|----------|---------|---|\n| - (instancetype) initWithFrame: | | (CGRect) | *frame* | |\n\nConstructs a new [GCKUICastButton](/cast/v3/reference/ios/interface_g_c_k_u_i_cast_button \"A subclass of UIButton that implements a \\\"Cast\\\" button. \") with the given frame. \n\n|---------------------------|---|------------------------------|------------------|\n| - (void) setInactiveIcon: | | (UIImage \\*) | *inactiveIcon* |\n| activeIcon: | | (UIImage \\*) | *activeIcon* |\n| animationIcons: | | (NSArray\\\u003c UIImage \\* \\\u003e \\*) | *animationIcons* |\n| | | | |\n\nSets the icons for the active, inactive, and animated states of the button.\n\nThe supplied images should all be single-color with a transparent background. The color of the images is not significant, as the button's tint color (`tintColor` property) determines the color that they are rendered in. \n\n|---------------------------------|---|--------------------------------------------------------------------------------------------|---------|\n| - (void) setAccessibilityLabel: | | (NSString \\*) | *label* |\n| forCastState: | | ([GCKCastState](/cast/v3/reference/ios/g_c_k_common_8h#af0c098ac6b7bff89f13f0bad7b88a5b5)) | *state* |\n| | | | |\n\nSets the accessibility label for the cast states of the button.\n\nThis is the recommended way to set accessibility label for the button. Label set by setAccessibilityLabel: is applied to all cast states.\n\nProperty Detail\n---------------\n\n|-------------------------------------------------------------------------------|--------------------------|\n| |------------------------------------| | - (BOOL) triggersDefaultCastDialog | | readwritenonatomicassign |\n\nA flag that indicates whether a touch event on this button will trigger the display of the Cast dialog that is provided by the framework.\n\nBy default this property is set to `YES`. If an application wishes to handle touch events itself, it should set the property to `NO` and register an appropriate target and action for the touch event."]]