【发布时间】:2013-09-05 20:14:11
【问题描述】:
所以我正在尝试学习如何使用 Android 应用程序,并且我有一个名为 (id)“img_BarHealth”的 ImageView,我将其初始化为“160dp”。
我制作了一个按钮并将其连接到此功能:
public void onBack(View view) {
//Get link to the object.
ImageView bar_Health = (ImageView) findViewById(R.id.img_BarHealth);
//This is what I want done. (However this value is not accessable it seems)
bar_Health.width = "80dp";
}
那么,有什么建议吗? =)
【问题讨论】:
-
我想你需要的已经在这里了:stackoverflow.com/questions/3144940/…