안드로이드 개발 질문/답변
(글 수 45,052)
튜너를 만드려고 하는중인데요;;
아직 갈길이 정말 먼데...암튼간에요ㅠㅠ
FrameLayout을 이용해서 바늘을 중앙에 배치하고 싶은데 안되요ㅠㅠ
뭐가 안맞는지 자꾸 이상한데로만 가네요;;
좌표가 안맞는건지 뭐가 잘못됐는지 모르겠어요 고수님들 좀 도와주세요
public class Octave1 extends Activity {
/** Called when the activity is first created. */
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.octave1);
}
}
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<ImageView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:src="@drawable/tuner" />
<ImageView
android:src="@drawable/needle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:scaleType="fitXY"
android:layout_x="130px"
android:layout_y="130px"
/>
</FrameLayout>
아직 갈길이 정말 먼데...암튼간에요ㅠㅠ
FrameLayout을 이용해서 바늘을 중앙에 배치하고 싶은데 안되요ㅠㅠ
뭐가 안맞는지 자꾸 이상한데로만 가네요;;
좌표가 안맞는건지 뭐가 잘못됐는지 모르겠어요 고수님들 좀 도와주세요
public class Octave1 extends Activity {
/** Called when the activity is first created. */
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.octave1);
}
}
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<ImageView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:src="@drawable/tuner" />
<ImageView
android:src="@drawable/needle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:scaleType="fitXY"
android:layout_x="130px"
android:layout_y="130px"
/>
</FrameLayout>
프레임 misc 항목에 xy 좌표및 높이 너비 설정항목이 나오는데 그걸로 활용해보세요^^