본문 바로가기

개발도구

[안드로이드] xml없이 layout, button, text 설정해보자! LinearLayout layout = new LinearLayout(getApplicationContext());// 리니어 레이아웃(뼈대 1) layout.setOrientation(LinearLayout.VERTICAL); // 리니어 레이아웃 자식붙이기 (뼈대2) LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams( LinearLayout.LayoutParams.FILL_PARENT, LinearLayout.LayoutParams.FILL_PARENT); layoutParams.setMargins(0,0,0,0); layoutParams.weight = 1.0f; mGallery.setIsGalleryCircular(fal.. 더보기
[안드로이드] 메뉴 이미지 변경 버튼 위와 같이 탑에 메뉴를 넣기 원한다면, 아래와 같이 사용해 보면 좋을거 같습니다. onCreate() 에 선언 mainTabListenerOn(); // menuMain1 이미지 버튼 5개에 관한 클래스 버튼 이름은 mainMenu1 , 2,3,4... inculde 이름은 Main_menu1,2,3,4.... 간단하게 처리가능합니다. :) ... 버튼 클릭시 이벤트 public void mainTabListenerOn() { findViewById(R.id.mainMenu1).setOnClickListener( new ImageButton.OnClickListener() { public void onClick(View v) { mainContentToggle(v); } }); findViewById(R.. 더보기
[안드로이드] tab line 없애기 tabStripEnabled 탭 밑에 라인을 tabStrip 라고 부른다. TabWidget android:tabStripEnabled="false" 단 sdk 8 부터 적용이 된다. 유의하자! 더보기
[안드로이드] tab 높이 조절 android:layout_width="fill_parent" android:layout_height="70px" android:gravity="center" /> 더보기
[안드로이드] 인트로 화면 구성하기 public class Intro extends Activity { Handler myHandler = new Handler(); Runnable myRunnable = new Runnable() { public void run() { Intent i = new Intent(Intro.this, Host.class); overridePendingTransition(R.anim.fade, R.anim.hold); i.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); Intro.this.startActivity(i); finish(); - 백했을경우 닫아 버리기 // overridePendingTransition(0,0); // startActivity(new Inten.. 더보기
[안드로이드] tabHost 와 tab버튼 이미지 변경 protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.host); tabHost = getTabHost(); tabHost.setOnTabChangedListener(this); tabHost.addTab(tabHost.newTabSpec("tab1") .setIndicator("",getResources().getDrawable(R.drawable.tab_menu1_off)) .setContent(new Intent(this, PhotoSwitcher.class))); tabHost.addTab.. 더보기
[안드로이드] 타이틀바 없애기 AndroidMenifest.xml에 적용 Application 전체에 적용 application에 android:theme="@android:style/Theme.NoTitleBar" 삽입 특정 Activity 에 적용 activity에 android:theme="@android:style/Theme.NoTitleBar" 삽입 Code에 적용 TestClass.java setContentView() 보다 먼저 처리되야 한다. import android.app.Ativity; import android.os.Bundle; public class TestClass extends Activity { @Override public void onCreate(Bundle savedInstanceState) { .. 더보기
Log.d 숫자 찍어보기 Log.d("111", this.getString(temp_id)); 형변환 int temp = Integer.parseInt(a.getText().toString()); int.Parser()는 이렇게 사용하시면 됩니다.^^ 혹은 int temp = Integer.valueOf(a.getText().toString()); 더보기
[안드로이드] 인트로 intro 구성하기 package kr.co.mt; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.util.Log; import android.view.KeyEvent; import android.view.Window; /** * 초기화면 * * @author joon * */ public class Intro extends Activity { Handler myHandler = new Handler(); Runnable myRunnable = new Runnable() { public void .. 더보기
[안드로이드] ListView에 header 을 달자! - addHeaderView private View header; header = null; header = inflater.inflate(R.layout.header, null); // header.xml g = (MyGallery) header.findViewById(R.id.gallery); titlelistTxt = (TextView) header.findViewById(R.id.titlelistTxt); layout = (LinearLayout) header.findViewById(R.id.dotPanel); // list3 는 R.layout.main list3.addHeaderView(header); // * addheaderview 는 단 한번만 실행이 되야 한다. 여러번 실행되어도 에러는 안나지만, 화면이 떨리거나,.. 더보기