#import <FlutterView.h>
Definition at line 49 of file FlutterView.h.
◆ initWithCoder:
| - (instancetype) initWithCoder: |
|
(NSCoder*) |
NS_UNAVAILABLE |
|
Definition at line 24 of file FlutterView.mm.
38 NSAssert(NO,
@"FlutterView must initWithDelegate");
◆ initWithDelegate:opaque:enableWideGamut:
| - (instancetype) initWithDelegate: |
|
(id<FlutterViewEngineDelegate>) |
delegate |
| opaque: |
|
(BOOL) |
opaque |
| enableWideGamut: |
|
(BOOL) |
NS_DESIGNATED_INITIALIZER |
|
|
| |
Definition at line 24 of file FlutterView.mm.
137 :(id<FlutterViewEngineDelegate>)delegate
139 enableWideGamut:(BOOL)isWideGamutEnabled {
140 if (delegate == nil) {
141 NSLog(
@"FlutterView delegate was nil.");
145 self = [
super initWithFrame:CGRectNull];
148 _delegate = delegate;
149 _isWideGamutEnabled = isWideGamutEnabled;
150 self.layer.opaque = opaque;
152 _intrinsicSize = CGSizeMake(UIViewNoIntrinsicMetric, UIViewNoIntrinsicMetric);
◆ initWithFrame:
| - (instancetype) initWithFrame: |
|
(CGRect) |
NS_UNAVAILABLE |
|
Definition at line 24 of file FlutterView.mm.
33 NSAssert(NO,
@"FlutterView must initWithDelegate");
◆ NS_UNAVAILABLE [1/2]
| + (instancetype) NS_UNAVAILABLE |
|
|
|
◆ NS_UNAVAILABLE [2/2]
| - (instancetype) NS_UNAVAILABLE |
|
|
|
◆ pixelFormat
| - (MTLPixelFormat) pixelFormat |
|
|
|
Definition at line 24 of file FlutterView.mm.
112 if ([
self.layer isKindOfClass:[CAMetalLayer
class]]) {
115 #pragma clang diagnostic push
116 #pragma clang diagnostic ignored "-Wunguarded-availability-new"
117 CAMetalLayer* layer = (CAMetalLayer*)
self.layer;
118 return layer.pixelFormat;
120 return MTLPixelFormatBGRA8Unorm;
◆ resetIntrinsicContentSize
| - (void) resetIntrinsicContentSize |
|
|
|
A method that resets and recalculates the instrinsic content size Currently called when the device orientation changes.
Definition at line 24 of file FlutterView.mm.
99 _intrinsicSize = CGSizeMake(UIViewNoIntrinsicMetric, UIViewNoIntrinsicMetric);
100 [
self removeAutoResizeLayoutConstraints];
◆ screen
Definition at line 24 of file FlutterView.mm.
43 return self.window.windowScene.screen;
◆ setIntrinsicContentSize:
| - (void) setIntrinsicContentSize: |
|
(CGSize) |
size |
|
A method that sets the instrinsic content size This is used when autoResizable is enabled.
Definition at line 24 of file FlutterView.mm.
57 UIWindow* window =
self.window;
58 CGFloat scale = window ?
self.window.windowScene.screen.scale :
self.traitCollection.displayScale;
59 CGSize scaledSize = CGSizeMake(size.width / scale, size.height / scale);
61 CGSize roundedScaleSize = CGSizeMake(roundf(scaledSize.width), roundf(scaledSize.height));
62 CGSize roundedIntrinsicSize =
66 if (CGSizeEqualToSize(roundedIntrinsicSize, roundedScaleSize)) {
71 self.translatesAutoresizingMaskIntoConstraints =
false;
74 [
self removeAutoResizeLayoutConstraints];
78 attribute:NSLayoutAttributeWidth
79 relatedBy:NSLayoutRelationEqual
81 attribute:NSLayoutAttributeNotAnAttribute
83 constant:scaledSize.width];
87 attribute:NSLayoutAttributeHeight
88 relatedBy:NSLayoutRelationEqual
90 attribute:NSLayoutAttributeNotAnAttribute
92 constant:scaledSize.height];
94 [NSLayoutConstraint activateConstraints:@[ widthConstraint, heightConstraint ]];
95 [
self setNeedsLayout];
◆ autoResizable
The documentation for this class was generated from the following files: