나는 안드로이드 개발에 초보자입니다. 내 페이지 요소를 세로로 정렬하려고하지만이를 수행 할 수 없습니다. Java에서 프런트 엔드 레이아웃 컨트롤을 어떻게 사용할 수 있는지 잘 모르겠습니다. 다음과 같이android studio에서 수직으로 다른 요소를 정렬하는 방법은 무엇입니까?
내 main.xml에 파일은 다음과 같습니다
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context=".MainActivity">
<!--<View-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="30dip"/>-->
<TextView
android:text="@string/getVerse"
android:layout_width="wrap_content"
android:layout_height="100dip"
android:textSize="@dimen/header"
android:layout_gravity="center_horizontal"
/>
<!--<View-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="20dip"-->
<!--/>-->
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:textSize="@dimen/questionSize"
android:hint="@string/questionHint"
/>
<!--<View-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="25dip"-->
<!--/>-->
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:textSize="@dimen/buttonTextSize"
android:text="@string/buttonText">
</Button>
</LinearLayout>
페이지는 다음과 같습니다
제발 도와주세요!
android:orientation="vertical"
있는 LinearLayout 부모에 코드를 다음
내 대답보기 @ user3641971 –
@Lal 어떻게 중복 될 수 있습니까? 나는 그 문제를 봤는데 어떤 결과도 얻을 수 없었다. – user3641971
내 코멘트가있는 링크를 참조하십시오. – Lal