1
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<Button
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/go"
android:text="go"
/>
선형 레이아웃의 버튼 아래에 원을 추가하고 싶습니다. 어떻게해야합니까? main.xml을 변경해야합니까?안드로이드에서 버튼을 클릭하면 원을 그리는 방법은 무엇입니까?
public class SomeActivity extends Activity {
private Button checkButton;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
start();
}
private void start() {
checkButton=(Button)findViewById(R.id.go);
checkButton.setOnClickListener(new View.OnClickListener(){
public void onClick(View v){
}
});
}
무엇을 onClick 메서드에 입력해야합니까?
감사로 설정 :
는 비트 맵을 만드시겠습니까? @ Marko Niciforovic – srk나는 나의 대답을 편집했다. 이제 모든 가치가있다. 원의 페인트 (색)와 나머지 값을 원하는대로 수정할 수 있습니다. –
오류가 표시되지 않지만 작동하지 않습니다. – srk