-
-
Save udacityandroid/7a9b5288975819fa2c25 to your computer and use it in GitHub Desktop.
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
tools:context=".MainActivity"> | |
<TextView android:text="Happy Birthday YOURFRIENDHERE" android:layout_width="wrap_content" | |
android:layout_height="wrap_content" /> | |
</RelativeLayout> |
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/androidparty" />
<TextView android:text="Happy Birthday mofta7!" android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView android:text="from taifa" android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"/>
Hi All
My TextView androidtext="from" will not move right, or to the bottom when I enter the lines of (layout_alignParentRight, or Bottom). I have even tried copying some of the examples here, but nothing seems to work. Android Studio keeps saying I should use (alignParentEnd) and once I do there is says I should also add (alignParentRight). ???
However I have adding to use the drag and drop functions within the program, which is a quick solution, but overall it seems I am missing something. Any idea?
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:text="From John"
from FooBar167
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.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=".MainActivity">
<ImageView
android:id="@+id/party"
android:src="@drawable/androidparty"
android:contentDescription="@string/img_description"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop" />
<TextView
android:layout_width="match_parent"
android:layout_height="@dimen/size_large"
app:autoSizeTextType="uniform"
android:lines="1"
android:gravity="center"
android:text="@string/happy_birthday_alex"
android:textColor="@color/colorYellow"
app:fontFamily="cursive"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:paddingTop="@dimen/vertical_margin"
android:paddingBottom="@dimen/vertical_margin"
android:paddingLeft="@dimen/horizontal_margin"
android:paddingRight="@dimen/horizontal_margin" />
<TextView
android:layout_width="match_parent"
android:layout_height="@dimen/size_small"
app:autoSizeTextType="uniform"
android:lines="1"
android:gravity="end"
android:text="@string/from_dzmitry"
android:textColor="@color/colorYellow"
app:fontFamily="cursive"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent"
android:paddingTop="@dimen/vertical_margin"
android:paddingBottom="@dimen/vertical_margin"
android:paddingLeft="@dimen/horizontal_margin"
android:paddingRight="@dimen/horizontal_margin" />
</androidx.constraintlayout.widget.ConstraintLayout>
i have a constrain layout.
how can i make a relative layout instead?
how can I use me iPhone on the android studio or making the emulater
<ImageView
android:id="@+id/img_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/hamada"
android:scaleType="centerCrop"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Happy BirthDay ياحمادة يا صديق العمر "
android:textSize="36sp"
android:paddingLeft="10dp"
android:paddingTop="10dp"
android:layout_alignParentLeft="true"
android:layout_alignTop="@+id/img_main"
android:textColor="@android:color/white"
android:fontFamily="sans-serif-condensed"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="من محمد"
android:textSize="36sp"
android:padding="10dp"
android:fontFamily="serif"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:textColor="@android:color/white"
/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id = "@+id/androidparty"
android:src="@drawable/androidparty" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="From Awais"
android:textSize="40sp"
android:textStyle="bold" />
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentBottom="true"
android:gravity="bottom"
android:text="Happy birthday Ahmed"
android:textStyle="bold"
android:textSize="40sp" />
<TextView
android:id="@+id/happyBTV"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:padding="20dp"
android:text="Happy Birthday Rocio"
android:textSize="30sp"
android:textStyle="bold"
android:textColor="@android:color/darker_gray"/>
<ImageView
android:id="@+id/imagen"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:src="@drawable/androidparty" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:padding="20dp"
android:text="From Marcos"
android:textSize="25sp"
android:textStyle="bold"
android:textColor="@android:color/darker_gray"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/androidparty"
android:scaleType="centerCrop"
/>
<TextView android:text="Happy birthday Ben!"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="36sp"
android:fontFamily="sans-serif-light"
android:textColor="@android:color/white"
android:padding="20dp"/>
<TextView android:text="From Sadat"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:textSize="36sp"
android:fontFamily="sans-serif-light"
android:textColor="@android:color/white"
android:padding="20dp"/>
![Screen Shot 2020-05-23 at 5 50 36 AM](https://user-images.githubusercontent.com/64886805/82722810-72f89d00-9cb9-11ea-9aa5-d457ede2ff96.png)
Menda cheklash tartibi mavjud.
qanday qilib uning o'rniga nisbiy tartibni qila olaman?
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/MAILRAYS"
android:padding="20dp"
android:text="Happy birthday tarik"
android:textColor="@android:color/white"
android:textSize="40sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:fontFamily="@font/ChopinScript"
android:padding="30dp"
android:text="From tarik"
android:textColor="@android:color/white"
android:textSize="36sp" />
https://www.udacity.com/api/nodes/4034888704/supplemental_media/androidpartyjpg/download
I wonder why I can't set other images rather than providing one.!
solved
android:scaleType="cenerCrop" for the image
show me logcat
Cool great thanks
Thanks for the awesome course as a android beginner.
please help me
I don't have an android phone
How can i run the app??
@hadeel-18 use an emulator
My variant
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"