Center content in scroll view

You can use android:fillViewport=”true” to center the content. Something like this: <ScrollView xmlns:android=”http://schemas.android.com/apk/res/android” android:layout_width=”match_parent” android:layout_height=”match_parent” android:fillViewport=”true”> <!– content –> </ScrollView>

Vertical content align in Android EditText

Try this: android:gravity=”top” <EditText android:layout_gravity=”center” android:id=”@+id/txtMessage” android:layout_height=”wrap_content” android:layout_below=”@+id/lblMessage” android:layout_width=”wrap_content” android:width=”250dip” android:text=”hello” android:maxLength=”760″ android:gravity=”top” android:lines=”4″/> so android:gravity=”top” sets the text at the “Top” Position. You can also set different android:gravity attribute value such as center, bottom, center_vertical, left, right, center_horizontal, etc. Enjoy !!

Android – Center TextView Horizontally in LinearLayout

What’s happening is that since the the TextView is filling the whole width of the inner LinearLayout it is already in the horizontal center of the layout. When you use android:layout_gravity it places the widget, as a whole, in the gravity specified. Instead of placing the whole widget center what you’re really trying to do … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)