我在TableLayout/TableRow中有一個ImageButton。android set imagebutton in tablerow
我想在整個的TableRow傳播的ImageButton和設置PIC 在按鈕(高度像tablerow的/按鈕高度)
我在layoutfile設置的中心......
<TableLayout android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TableRow >
<ImageButton
android:id="@+id/CarPic"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="onButtonClick"
android:scaleType="centerInside"
android:src="@drawable/etype" />
</TableLayout>
當應用程序啓動默認PIC看起來像我描述 - 但是當我oncli更改CK按鈕的PIC ... 按鈕大小調整爲PIC高度/在右上角寬度的住宿
代碼填充該
Drawable d = Drawable.createFromPath(Path);
LPic.setImageDrawable(d);
我已經嘗試了許多不同的版本:(和包裹,但 該鍵可以改變每一個畫面
我有這個問題,你有沒有發現任何解決方案? –