2
我有一個textView,我試圖在運行時更改大小。但尺寸不合格。Android:嘗試在運行時更改TextView的寬度
在XML文件中的代碼上OnCreat
<TextView
android:id="@+id/textScreenWidth"
android:layout_width="100px"
android:layout_height="wrap_content"
android:text=""
android:layout_gravity="center"
android:textColor="#ff000000"
android:textStyle="bold"
android:textSize="12dp"
代碼來改變大小
TextView t=(TextView) findViewById(R.id.textScreenWidth);
t.setWidth(950);
大小不會改變