안드로이드 개발 질문/답변
(글 수 45,052)
checkbox를 생성하여. 화면의 오른쪽 상단에 바짝 붙이려고하는데 위와 오른쪽에 여백이 생깁니다..
체크박스 옆에 글씨는 안쓰고 체크박스만 사용하려고하는데..
위와 오른쪽에 여백이 생기는데 안생기게 만들수있을지 질문합니다.
아래처럼 layout_gravity를 이용해 위오 오른쪽 정렬하라고햇는데 여백이 생기고 마음데로 가질 않내요..
방법아시면 알려주세요.. 부탁드립니다.
<FrameLayout
android:layout_width="98.6dp"
android:layout_height="74.6dp"
android:background="#000000"
>
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="top|right"
/>
</FrameLayout>
체크박스 옆에 글씨는 안쓰고 체크박스만 사용하려고하는데..
위와 오른쪽에 여백이 생기는데 안생기게 만들수있을지 질문합니다.
아래처럼 layout_gravity를 이용해 위오 오른쪽 정렬하라고햇는데 여백이 생기고 마음데로 가질 않내요..
방법아시면 알려주세요.. 부탁드립니다.
<FrameLayout
android:layout_width="98.6dp"
android:layout_height="74.6dp"
android:background="#000000"
>
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="top|right"
/>
</FrameLayout>
FrameLayout의 범위 안에서라면 제대로 붙는걸로 나오는데요?
혹시 화면 전체의 상단 오른쪽을 원하신게 아닌지요?
그런거라면
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<FrameLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#ff00AA" <== 일부러 알아보기 쉽게 색구분좀 했습니다.
>
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="top|right"
/>
</FrameLayout>
</RelativeLayout>