Giorgi Tsiklauri
Giorgi Tsiklauri

Reputation: 11138

What is the difference between android:layout_alignRight="ID" and android:layout_toRightOf="ID"?

What is the difference between android:layout_alignRight="@id/someId" and android:layout_toRightOf="@id/someId"?

Upvotes: 6

Views: 3498

Answers (2)

Junaid
Junaid

Reputation: 7860

This picture will explain the difference :

enter image description here

Upvotes: 20

laalto
laalto

Reputation: 152917

layout_alignRight aligns the right edges of the two views.

layout_toRightOf aligns the left edge of this view with the right edge of the other someId view.

Documentation: http://developer.android.com/reference/android/widget/RelativeLayout.LayoutParams.html

Upvotes: 6

Related Questions