私は現在、AndroidアプリケーションをAndroid 6で実行するように取り組んでいます。私はAndroid開発に全く新しいですが、WPFの経験が少しあります。似ている。Android Relative Layout 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スタジオビューレンダラーでは正しく表示されません。また、あらゆる種類の電話で表示されます。 RelativeLayoutを含むTableRowが画面全体を占めてしまうので、ボタンは表示されません...
親として 'TableLayout'の代わりに' RelativeLayout'を使用してください。あなたの一番上の行を親と下の行に親の下に揃えます。 'RelativeLayout'はすべての並べ替えを行います。 –