2010-09-06 54 views
0
<ImageView android:id="@+id/ImageView01" 
    android:layout_gravity="center_horizontal" 
    android:layout_marginTop="30dip" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:scaleType="fitCenter" 
    android:adjustViewBounds="true"> 

喜的朋友, 我想在編碼圖像視圖不使用它來設置該屬性,我怎麼能做到嗎?如何設置圖像視圖屬性編碼爲Android

感謝您的Java代碼中的所有

回答

0

有像TextView的,你可以做一些這方面的方法:

TextView test = (TextView)find...; 

test.setText("blah blah"); 

test.setId("blah"); 

test.setTextColor() 

ect

等了ImageView的是大同小異: 把你的ImageView,如果你有日食+ ADT(我希望)這幾乎是自動

ImageView picture = (ImageView) findViewById(R.id.ImageView01); 
picture.setLayoutParams(picture.LayoutParams.WRAP_CONTENT, picture.LayoutParams.WRAP_CONTENT); 

和等。 = D

相關問題