-
Notifications
You must be signed in to change notification settings - Fork 24.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create a Android custom view #3251
Comments
You should be able to use or create any Android view. I did wrap the TabLayout which do have the tabs as subviews in a layout (can't remember which strait from my head). |
I finally found how to do, sorry for the useless issue. |
@jujumoz how did you do it? I am facing a similar problem |
I am trying to inflate a LL with an xml file |
Nevermind I figured it out, they should add a better example.... |
@amilcar-andrade : Sorry for the delay. In your ReactPackage :
And then two classes :
In the res/layout folder of your module, just add the custom_layout.xml . |
I custom layout witch dynamic add child view by RN setState.The first render the view,it just display ok,but when I change the prop 'source'(the view ReactProp) by setState,it can't display the child view.I had set the view width and height.can you help how to solve |
@jujumoz Can You share your full code please.. |
@jujumoz Hi Jujumoz , can you share your full code ? |
@minhnhatspk, @riteshvish Here is what I have working:
House your custom_layout.xml inside |
@helengray Did you fix it? |
I try to implement a custom view in a Android app. In the following code, my Toast is called but then I would like to apply a layout to my view.
Can I extend my class from something else to be able to add LinearLayout or whatever, set height and width and put some elements inside ? Can I use a xml layout that I could inflate ? The doc is not so accurate ...
I hope to be clear in my question.
Thank you very much for your answers.
The text was updated successfully, but these errors were encountered: