Android Studio Emulator do not show the designed layoutAndroid Studio中模擬器不顯示的設計佈局
我試圖讓我在Android首次應用程序,但即使只有2文本字段和1個按鈕在我的簡單的應用程序總是浮到模擬器的角落。我曾嘗試將Android映像更改爲x86或安裝HAXM,或嘗試在具有不同佈局設計的另一臺計算機上嘗試,但事情不會改變。
我是Android的新手,所以我希望能得到您的幫助。
這裏是我的文件activity_main.xml中
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout 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"
tools:context="com.example.admin.button.MainActivity">
<EditText
android:id="@+id/editText"
android:layout_width="368dp"
android:layout_height="wrap_content"
android:ems="10"
android:hint="Username"
android:inputType="textPersonName"
tools:layout_editor_absoluteX="8dp"
tools:layout_editor_absoluteY="5dp" />
<EditText
android:id="@+id/editText2"
android:layout_width="368dp"
android:layout_height="wrap_content"
android:ems="10"
android:hint="Password"
android:inputType="textPersonName"
tools:layout_editor_absoluteX="8dp"
tools:layout_editor_absoluteY="62dp" />
<Button
android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Log In"
tools:layout_editor_absoluteX="148dp"
tools:layout_editor_absoluteY="118dp" />
</android.support.constraint.ConstraintLayout>
你可以發佈你的activity_main.xml嗎? – Raghavendra
如果沒有您的代碼,我們不能幫助您,所以請添加您的代碼,甚至在另一臺計算機上嘗試過,因爲您的代碼有一些問題,而不是模擬器。 – Zaid
是的,我現在將它發佈 – Dan