我正在尝试构建一个简单的Android应用。 在模拟器上,网格完美地显示按钮,但是当将应用程序安装到我的移动设备时,网格看起来很糟糕 以下是XML文件:
database.child(Table).
orderByChild("user/id")
.equalTo("somevalue").
答案 0 :(得分:1)
您可以在不使用<GridLayout>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_main"
android:layout_width="match_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">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_weight="1"
android:layout_height="0dp">
<Button
android:text="Good Morning"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
android:onClick="Buttontapped"
android:id="@+id/goodmorning" />
<Button
android:text="Good Evening"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
android:onClick="Buttontapped"
android:id="@+id/goodevening" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_weight="1"
android:layout_height="0dp">
<Button
android:text="Good Bye"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
android:onClick="Buttontapped"
android:id="@+id/goodbye" />
<Button
android:text="HI / Bye"
android:id="@+id/hibye"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
android:onClick="Buttontapped"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_weight="1"
android:layout_height="0dp">
<Button
android:text="Please"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
android:onClick="Buttontapped"
android:id="@+id/please" />
<Button
android:text="Thank You Very Much"
android:id="@+id/thankyou"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
android:onClick="Buttontapped"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_weight="1"
android:layout_height="0dp">
<Button
android:text="Welcome"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
android:onClick="Buttontapped"
android:id="@+id/welcome" />
<Button
android:text="How are you?"
android:id="@+id/howareyou"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
android:onClick="Buttontapped"/>
</LinearLayout>
</LinearLayout>