Issue
In xml you can do the following:
<TextView
...
android:layout_centerHorizontal="true"
...
/>
How would I, when I have the instance of TextView
, do this programmatically?
Solution
You should use the addRule
method of the RelativeLayout.LayoutParams
class.
layoutparams.addRule(RelativeLayout.CENTER_HORIZONTAL);
mTextView.setLayoutParams(layoutParams);
Answered By - Ronnie
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.