【发布时间】:2016-01-03 01:13:02
【问题描述】:
我是 android 新手,正在开发我的第一个应用程序,它来自一个在线课程项目。事实是,在 Android Studio 上,该应用程序运行良好,但我构建了 apk 文件以在我的手机(Samsung Galaxy s3 mini)上对其进行测试。在设备上,应用程序未显示完整,因为它缺少编辑文本和布局底部的按钮。我附上了两个屏幕截图,第一个是在模拟器上运行的应用程序,另一个是在我的智能手机上运行的应用程序。
在模拟器中运行的应用程序:
在智能手机上运行的应用程序:
布局代码:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="10dp"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context="com.linfosoft.hangdroid.GameActivity"
tools:showIn="@layout/activity_game">
<ImageView
android:layout_width="wrap_content"
android:layout_height="350dp"
android:id="@+id/imageView"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:src="@drawable/hangdroid_0"
android:layout_marginTop="20dp" />
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:baselineAligned="false"
android:background="@drawable/gradient_background"
android:layout_below="@+id/imageView"
android:layout_centerHorizontal="true"
android:id="@+id/layoutAddLetter"
android:layout_marginTop="90dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Ingresa letra"
android:id="@+id/textView2"
android:layout_gravity="center_vertical"
android:layout_marginLeft="40dp" />
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/editText"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:maxLength="1" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Revisar"
android:id="@+id/button2"
android:onClick="introduceLetter" />
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/imageView"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="false"
android:layout_alignParentTop="false"
android:layout_marginTop="20dp"
android:id="@+id/layoutLetters">
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:id="@+id/textView7"
android:layout_marginTop="150dp"
android:layout_marginLeft="20dp"
android:textColor="@color/red" />
</RelativeLayout>
【问题讨论】:
-
你有设备特定的布局吗?
-
发布您的布局文件。
-
更新帖子并包含布局代码。
标签: android android-studio apk