현재 Android 6에서 실행되는 Android 애플리케이션을 개발 중입니다. Android 개발에 완전히 익숙하지만 WPF 경험이 조금 있습니다. 비슷하다.TableRow에서 안드로이드 관련 레이아웃과 Linear 레이아웃이있는 TableRow
이 내가 현재이 문제를 해결해야하는 XML입니다 : 다음은 내가처럼 보이게보기를 원하는 것입니다 큰 장치에서 잘 작동
<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/activity_guimain"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:weightSum="2"
tools:context="indoorpilot.indoorpilot.GUIMain">
<TableRow>
<!--android:layout_width="match_parent">-->
<TextView
android:id="@+id/textView"
android:layout_weight="1"
android:gravity="center_horizontal"
android:text="Building Label"/>
</TableRow>
<TableRow>
<RelativeLayout
android:layout_weight="1">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:srcCompat="@drawable/mclaurysecondfloor"
android:id="@+id/imageView2"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:srcCompat="@android:drawable/presence_online"
android:="@+id/markerImage"/>
</RelativeLayout>
</TableRow>
<TableRow>
<LinearLayout
android:layout_weight="1"
style="?android:attr/buttonBarStyle">
<Button
style="?android:attr/borderlessButtonStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/contextual_info"
android:onClick="ShowContextualInformation"/>
<Button
style="?android:attr/borderlessButtonStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/scan_button"
android:onClick="SetRSSIDistanceValues"/>
</LinearLayout>
</TableRow>
</TableLayout>
(태블릿).하지만 Android Studio View 렌더러 또는 다른 유형의 휴대 전화에서는 제대로 표시되지 않습니다. RelativeLayout을 포함하는 TableRow가 전체 화면을 차지하므로 결국 버튼이 표시되지 않습니다.
부모로서'TableLayout' 대신에'RelativeLayout'을 사용하십시오. 상단 행을 부모 행과 하단 행을 부모 행 아래에 맞 춥니 다. 'RelativeLayout'은 모든 정렬을 제공합니다. –