2017-07-31 16 views
-1

私はthis.iで私を助けgoogle android.soを学んでいます右下のテキストを配置しようとしています。android:layout_alignParentBottom、android:layout_alignParentRight正しく配置されていません

<?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.dredd.happybirthday.MainActivity"> 

     <TextView 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:text="happy birthday srikanth" 
     /> 

    <TextView 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignParentBottom="true" 
     android:layout_alignParentRight="true" 
     android:text="from dayakar " 
     /> 

    <ImageView 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:src="@drawable/android" 
     /> 
</android.support.constraint.ConstraintLayout> 

screenshot

+0

は相対的なレイアウト – AbuQauod

+0

利用のLinearLayoutまたは相対レイアウト –

+0

に入れますどうやって 私はそれを行うことができます今、私はandorid studioを使用していますconstraintlayout –

答えて

0

<RelativeLayout 
    android:layout_width="match_parent" 
    android:layout_height="match_parent"> 
     <TextView 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:text="happy birthday srikanth" 
     /> 

     <TextView 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignParentBottom="true" 
     android:layout_alignParentRight="true" 
     android:text="from dayakar " 
     /> 

     <ImageView 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:src="@drawable/disha" 
     /> 
</RelativeLayout> 
+0

兄弟ありがとうございました。 –

+0

大歓迎コーディング –

+0

@dayakarreddyあなたは私のansを受け入れることができます –

0

これを試してみてくださいコードの下のようなあなたのlayoutを変更RelativeLayoutこのユーザーを試してみてください。

<TextView 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_alignParentBottom="true" 
    android:layout_alignParentRight="true" 
    android:layout_constraintRight_toRightOf="parent" 
    android:layout_constraintBottom_toBottomOf="parent" 
    android:text="from dayakar " 
    /> 
+0

あなたのresponse.butのためにありがとう、それは仲間を働いていません。 –

+0

レイアウトはどうなりますか? –

+0

それは同じです。何も起こっていません。 –

関連する問題