안드로이드 개발 질문/답변
(글 수 45,052)
<?xml version="1.0" encoding="utf-8"?>
<AbsoluteLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView android:id="@+id/tv1"
android:text="test is test"
android:layout_width="320px"
android:layout_height="240px"
android:layout_x="0px"
android:layout_y="0px"
/>
</AbsoluteLayout>
액티비티의 레이아웃 xml 파일이 위와 같이 정의 되어 있습니다.
그리고 액티비티의 onCreate 함수에서 TextView를 가져와 left, top, width, height 값을
모조리 바꿔주려고 합니다.
어떤함수를 이용하면 되는지 알려 주시면 감사하겠습니다.
그리고, width, height 값을 px 단위로 넣는 것은 권장하지 않더군요.
폰마다 화면의 크기가 달라지기 때문이라고 합니다.