There two way to add view dynamically .
-
you create you
xml
file .then usingLayoutInflater
you lnflater that xml to yourview
. -
Or You can create view dynamically like var
textview=TextView()
then textview.text=”xyz”
You need relativelayout or linearlayout where will add those will using addView();
method.
But i condition you have declare your view then you can customize at runtime.
you can check the example