NSInteger rand = arc4random() % 10 +1;

// 1〜10


Posted by tenn
,

[android] layout center

Android 2012. 12. 24. 00:42


ImageView in FrameLayout



ImageView iv = new ImageView(MainActivity.this);

iv.setImageDrawable(MainActivity.this.getResources().getDrawable(drawable.arrow));

LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);

lp.width = 100;

lp.height = 30;

iv.setLayoutParams(lp);


float frame_center_x = frame.getWidth() /2;

float frame_center_y = frame.getHeight() /2;

iv.setX(frame_center_x - iv.getLayoutParams().width/2);

iv.setY(frame_center_y -  iv.getLayoutParams().height/2);


frame.addView(iv);





Posted by tenn
,

[android] gesture 제스쳐

Android 2012. 12. 22. 13:41




Posted by tenn
,