안녕하세요? ^0^ 안드로이드펍 고수님들께 항상 많은 도움 받고있습니다.ㅎㅎ
제가 아직 초짜라서 많이 부족한데, 저도 열심히해서 언젠가 다른분들의 질문에
답글 멋지게 달 날이 오겠죠 ^^ ㅎㅎ
다름이 아니오라, 아래 출석부프로그램에서 글자를 좀 위로 올리고 싶은데
방법이 생각이 안나서 그렇습니다.^^
그림처럼 조금 더 위로 올리려면 어떻게 해야하나요 ㅎㅎ
-----------출력시 모습------------
-----------src폴더의 java파일------------
package my.MWMK001;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageButton;
import android.widget.Toast;
public class MWMK001 extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
final ImageButton button = (ImageButton) findViewById(R.id.android_button1);
button.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
// Perform action on clicks
Toast.makeText(MWMK001.this, "1번학생부터 10번학생은..", Toast.LENGTH_SHORT).show();
Toast.makeText(MWMK001.this, "1번 바니.", Toast.LENGTH_SHORT).show();
Toast.makeText(MWMK001.this, "2번 또또.", Toast.LENGTH_SHORT).show();
Toast.makeText(MWMK001.this, "3번 곰돌이.", Toast.LENGTH_SHORT).show();
}
});
final ImageButton button2 = (ImageButton) findViewById(R.id.android_button2);
button2.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
// Perform action on clicks
Toast.makeText(MWMK001.this, "11번학생부터 20번학생은..", Toast.LENGTH_SHORT).show();
Toast.makeText(MWMK001.this, "11번 지영.", Toast.LENGTH_SHORT).show();
Toast.makeText(MWMK001.this, "12번 나나.", Toast.LENGTH_SHORT).show();
Toast.makeText(MWMK001.this, "13번 승리.", Toast.LENGTH_SHORT).show();
}
});
}
}
-----------main.xml 파일은 아래와 같습니다.------------
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<ImageButton
android:id="@+id/android_button1"
android:layout_width="50dip"
android:layout_height="50dip"
android:src="@drawable/icon"
/>
<ImageButton
android:id="@+id/android_button2"
android:layout_toRightOf="@id/android_button1"
android:layout_alignTop="@id/android_button1"
android:layout_width="50dip"
android:layout_height="50dip"
android:src="@drawable/android" />
</LinearLayout>
----------------------------
^^;; 첫 출석부 프로그램을 만드는데 너무 부족함을 많이 느낍니다. 아무쪼록 좋은 지적 부탁드립니다 ㅎㅎㅎ