I\'m trying to add a textView to a frameLayout. The TextView has wrap_content properties, so it grows when the text grows
textView
frameLayout
TextView
wrap_content
Setting the gravity programatically definitely works Please set the layout_gravity to right in the xml TextView.setGravity(Gravity.RIGHT);