SyntaxFix
Write A Post
Hire A Developer
Questions
This will center the text in a text view:
TextView ta = (TextView) findViewById(R.layout.text_view); LayoutParams lp = new LayoutParams(); lp.gravity = Gravity.CENTER_HORIZONTAL; ta.setLayoutParams(lp);