我是一名Android學習者,我試圖製作一個應用程序,將其顯示爲Toast.I在Android Studio上製作了應用程序,而且看起來沒問題,但是當我運行它時我的手機在Android 5.0上運行,所有的部件重疊,而在工作室中它看起來很好。請幫助。 這是它的外觀上的電話:小部件在Android應用中的活動中重疊
這是它的外觀在Android
<?xml version="1.0" encoding="utf-8"?>
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.rahulranjan.toast1.MainToast">
<Button
android:id="@+id/test1"
android:layout_width="368dp"
android:layout_height="wrap_content"
android:onClick="btnClick"
android:text="Click Me"
android:textColor="#00C957"
tools:layout_editor_absoluteY="130dp"
tools:layout_editor_absoluteX="8dp" />
<TextView
android:id="@+id/textView"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="Click Below to see Toast :"
tools:layout_editor_absoluteY="40dp"
tools:layout_editor_absoluteX="112dp"
android:textColor="#E3CF57"
/>
而且是的,我已經使用ConstrainLayout,我不知道爲什麼它不在這裏顯示在這個網站上。 感謝
刪除約束,並把相對佈局根 –
感謝@AvinashRoy,改變其相對於佈局的工作,但你能告訴我是什麼的問題約束佈局? –
請參閱頁面頂部橫幅中的鏈接問題。 [這個答案](https://stackoverflow.com/a/43422980)解釋得很好。 –