당신이 당신의 데모 그림에서와 같은 레이아웃을 달성하려면 당신이 귀하의 요구 사항에 맞는로이 레이아웃을 변경할 수 있습니다. 이것은 달성하고자하는 레이아웃을 제공합니다. 그리고이 레이아웃을 setContentView(R.layout.scanbar.xml);
메서드를 사용하여 MainActivity
님의 onCreate()
활동 방식으로 설정할 수 있습니다. 여기서 scanbar.xml은 아래에 설명 된 레이아웃입니다.
scanbar.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/rl_main"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<ImageView
android:id="@+id/some"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginTop="58dp"
android:background="@drawable/ic_about_us"
android:padding="2dp" />
<TextView android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/some"
android:text="some text"
android:padding="10dp"
android:layout_centerInParent="true" />
</RelativeLayout>
튜토리얼? 귀하의 요구 사항은 무엇입니까 정말 명확하지 않습니다. '모든 것은 분리 된 레이아웃 xml보기에서 정의되었으므로 (프로그램 적으로는 없음); 이것은 무엇을 의미합니까 ?? –
샘플 SDK 앱에서 잘라진보기 및이보기의 내용이 주요 활동 (분리 된 레이아웃을 사용하지 않고)에서 프로그래밍 방식으로 생성됩니다. 두 부분으로 나누어 활동을위한 분리 된 레이아웃을 원합니다 (스캔보기 및 텍스트보기) – redrom
은 Scanview가 일부 이미지 또는 무엇입니까? –