Set custom font size

This commit is contained in:
Joao Lourenco 2023-01-12 12:41:43 +00:00
parent 8ee1d38821
commit 5f6202f3fc
2 changed files with 6 additions and 1 deletions

View File

@ -740,7 +740,7 @@ public class InAppBrowser extends CordovaPlugin {
// Use TextView for text
TextView close = new TextView(cordova.getActivity());
close.setText(closeButtonCaption);
close.setTextSize(20);
close.setTextSize(14);
if (closeButtonColor != "") close.setTextColor(android.graphics.Color.parseColor(closeButtonColor));
close.setGravity(android.view.Gravity.CENTER_VERTICAL);
close.setPadding(this.dpToPixels(10), 0, this.dpToPixels(10), 0);

View File

@ -936,6 +936,11 @@ BOOL isExiting = FALSE;
// If color on closebutton is requested then initialize with that that color, otherwise use initialize with default
self.closeButton.tintColor = colorString != nil ? [self colorFromHexString:colorString] : [UIColor colorWithRed:60.0 / 255.0 green:136.0 / 255.0 blue:230.0 / 255.0 alpha:1];
NSUInteger fontSize = 14;
UIFont *font = [UIFont systemFontOfSize:fontSize];
NSDictionary *attributes = @{NSFontAttributeName: font};
[self.closeButton setTitleTextAttributes:attributes forState:UIControlStateNormal];
NSMutableArray* items = [self.toolbar.items mutableCopy];
[items replaceObjectAtIndex:buttonIndex withObject:self.closeButton];
[self.toolbar setItems:items];