Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ios/RNNButtonOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
@property(nonatomic, strong) RNNIconBackgroundOptions *iconBackground;
@property(nonatomic, strong) Bool *disableIconTint;
@property(nonatomic, strong) Bool *hideSharedBackground;
@property(nonatomic, strong) Color *backgroundColor;

- (RNNButtonOptions *)withDefault:(RNNButtonOptions *)defaultOptions;

Expand Down
21 changes: 21 additions & 0 deletions ios/RNNReactButtonView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,15 @@ - (void)updateConstraintsToFitSize {
}
}

- (void)didMoveToWindow {
[super didMoveToWindow];
if (@available(iOS 26.0, *)) {
if (![self designRequiresCompatibility] && self.window) {
[self syncButtonBackground];
}
}
}

- (void)layoutSubviews {
[super layoutSubviews];
if (@available(iOS 26.0, *)) {
Expand All @@ -76,9 +85,21 @@ - (void)layoutSubviews {
self.layer.affineTransform = CGAffineTransformMakeTranslation(tx, 0);
}
}
[self syncButtonBackground];
}
}

- (void)syncButtonBackground {
if (!_buttonBackgroundColor) return;

UIView *target = self.superview.superview.superview;
if (!target || target.bounds.size.height <= 0) return;

target.backgroundColor = _buttonBackgroundColor;
target.layer.cornerRadius = target.bounds.size.height / 2.0;
target.clipsToBounds = YES;
}

- (NSString *)componentType {
return ComponentTypeButton;
}
Expand Down
7 changes: 7 additions & 0 deletions src/interfaces/Options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,13 @@ export interface OptionsTopBarButton {
* @see {@link https://developer.android.com/guide/topics/resources/menu-resource|Android developer guide: Menu resource}
*/
showAsAction?: 'ifRoom' | 'withText' | 'always' | 'never';
/**
* (iOS 26+ only) Set a solid background color on the circular Liquid Glass
* platter behind the button. Ignored when UIDesignRequiresCompatibility is
* enabled or on iOS < 26.
* #### (iOS specific)
*/
backgroundColor?: Color;
}

export interface OptionsSearchBar {
Expand Down