<TextView
android:id="@+id/textName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/themeRed"
android:gravity="center"
android:text="longma"
android:textColor="@color/themeMain"
android:textSize="24sp" />
TextView textName = findViewById(R.id.textName);
textName.setText("更新文本");
textName.setTextSize(24);
textName.setGravity(Gravity.RIGHT);
textName.setTextColor(Color.WHITE);
网友评论