-4

初めてAndroidスタジオを学習しています。物理的なアンドロイドデバイスでプログラムを実行しようとしています。私が抱えている問題は、自分のコンテンツ(ウィジェット、テキストビュー、ボタン)が自分のデバイスの画面に表示されないということです。私が使用しているコンピュータに何か問題がありますか?私はエディタでウィジェットを見たり操作したりすることができますが、作成した画面上の多くのものは、青写真を除いて正しい場所に表示されません。ウィジェットはデザインビューで正しく表示されませんか?

私はすべての画像を添付していますので、みんなが見ることができます。私はこれをAMD A10- 9600p Radeon R5で実行しています。 助けてくれてありがとう。

<?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:ignore="MissingConstraints"> 

<TextView 
    android:text="TextView" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:id="@+id/textView2" 
    tools:ignore="UnknownId" 
    tools:layout_editor_absoluteY="42dp" 
    android:layout_marginStart="16dp" 
    app:layout_constraintLeft_toLeftOf="@+id/constraintLayout" 
    android:layout_marginLeft="16dp" /> 

<EditText 
    android:layout_width="0dp" 
    android:layout_height="0dp" 
    android:inputType="textMultiLine" 
    android:ems="10" 
    android:id="@+id/editText" 
    android:layout_marginTop="16dp" 
    app:layout_constraintTop_toBottomOf="@+id/textView2" 
    android:layout_marginStart="16dp" 
    app:layout_constraintLeft_toRightOf="@+id/textView2" 
    android:layout_marginLeft="16dp" 
    tools:ignore="UnknownId" 
    android:text="Hello this is my first app and I have no clue what I'm  doing! Hopefully this all works out! I just need a bunch of words so i can create scorolling i am just typing things as fast as i can its problaly mispselled but who realy gives a hooot! just like the pokemon. this comupuete is decent but the bang for the buck is where its at. I caould make raps for fday s but its ok oops i guess i need some more word so this lovely app can scroll like a bouss hog out of the kitchen i think ill go get some ice cream soon yes great idea mr culver holla at ur boy yes" 
    app:layout_constraintBottom_toTopOf="@+id/button3" 
    android:layout_marginBottom="16dp" 
    app:layout_constraintHorizontal_bias="0.75" 
    app:layout_constraintVertical_bias="0.8" 
    android:layout_marginEnd="16dp" 
    app:layout_constraintRight_toRightOf="@+id/constraintLayout" 
    android:layout_marginRight="16dp" /> 

<Button 
    android:text="CANCEL" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:id="@+id/button2" 
    tools:ignore="UnknownId" 
    tools:layout_editor_absoluteY="436dp" 
    tools:layout_editor_absoluteX="268dp" /> 

<Button 
    android:text="OK" 
    android:layout_width="88dp" 
    android:layout_height="48dp" 
    android:id="@+id/button3" 
    app:layout_constraintRight_toLeftOf="@+id/button2" 
    android:layout_marginEnd="16dp" 
    android:layout_marginRight="16dp" 
    tools:ignore="UnknownId" 
    app:layout_constraintBaseline_toBaselineOf="@+id/button2" /> 
</android.support.constraint.ConstraintLayout> 

Image from Android Device

Android Studio Screenshot

+0

レイアウトxmlを投稿してください。 –

答えて

0

あなたのウィジェットの多くは、実際に制約を持っていないようです。ツールを削除します:ignore = "MissingConstraints"属性は、欠落しているものを表示します。すべてのウィジェットは、少なくとも2つの制約(縦軸用、横軸用)で制約を受ける必要があります。

物事をデザインしている間に置く場所にウィジェットを置くのは、制約がない場合でもウィジェットを置くほうがはるかにいいからです。しかし、デバイス上では、それらの固定位置は使用されません。

+0

ありがとう!私はもう一度プロジェクトを作成し、うまく動作します。私はいくつかの制約を犯したに違いない。 –

関連する問題