Friday, 24 June 2016

Android relative layout problem with gravity



How can i put textview with id="naslov" to the center? I also tried with layout_gravity="center" but that doesn't work either.




android:layout_width="fill_parent"
android:layout_height="fill_parent">

android:id="@+id/naslov"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="20dip"
android:text="Povzetek"
android:gravity="center"/>

android:id="@+id/aha"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="10dip"
android:text="Vseh oddaj:"
android:layout_below="@id/naslov"/>


Answer




 android:layout_centerHorizontal="true"

No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...