How to avoid setting UIView width and height on native side? #64
Unanswered
BraveEvidence
asked this question in
Q&A
Replies: 2 comments
-
Hello @PritishSawant, I'm not sure what your end goal is, but if you create a view and set its frame manually, React Native will not know about that view and the view is under your control. React Native won't change size/location of view, it will only do so on view that it managers. If you are creating your own native component, you can set gradient directly on that component in native and let React Native figure out size and position of it. I'm happy to look more in-depth into this if you provide more details and example for the issue. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am trying to create a
fabric
module foriOS
In my
objective-c++
file while setting aUIView
, I have to assign aCGRect
at time ofinit
ofUIView
. If I don't on the native side and just give it on js side the view is not visible.Following does not work
Objective-C++
JS
Following works
Objective-C++
JS
but the issue is it occupies the width and height set on the
native
side and ignoresjs
sideI want to use
_view = [[UIView alloc] init];
without setting width and height on
native
side but setting it onjs
sideTo add on more to this if I take a
UIButton
or aUILAbel
instead ofCAGradientLayer
and apply constraints toUIView
then I don't have to setCGRectMake
toUIView
Also I don't want to pass width and height from the specs file, whatever I set from the style property should be applied
Beta Was this translation helpful? Give feedback.
All reactions