Add a Textview to a FrameLayout in a determined position

后端 未结 6 1767
旧巷少年郎
旧巷少年郎 2021-01-12 09:18

I\'m trying to add a textView to a frameLayout. The TextView has wrap_content properties, so it grows when the text grows

6条回答
  •  无人共我
    2021-01-12 10:03

    you can try it by set the gravity of text use it like-

    textview.setGravity(Gravity.center);
    

    othervise by xml set gravity to center so it will display you in center and if you'll use centerinparents so it will always apperas at the center of screen.

提交回复
热议问题