Add a Textview to a FrameLayout in a determined position

后端 未结 6 1805
旧巷少年郎
旧巷少年郎 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条回答
  •  Happy的楠姐
    2021-01-12 09:56

    Try to gravity or Layout gravity to your Framelayout or the Textview. It makes your Layout to the center of the screen. Use like this,

    android:layout_gravity="center"
    

    or

    android:gravity="center"
    

提交回复
热议问题