【发布时间】:2011-11-08 22:29:48
【问题描述】:
【问题讨论】:
-
DynamicAndroidButton button = new DynamicAndroidButton();剩下的唯一工作就是实现这个类。
-
如果你有任何代表,你可以提出赏金:)
标签: android
【问题讨论】:
标签: android
首先将适当的 import 添加到您的 Activity:
import android.widget.Button;
然后在 onCreate 方法中创建一个新的按钮对象:
Button myButton = new Button(this);
myButton.setText("Press Me");
最后将按钮添加到布局中:
LinearLayout layout = (LinearLayout) findViewById(R.id.layout1);
layout.addView(myButton);
【讨论】: