Tuesday, 15 February 2011

Android LinerLayout not aligned -



Android LinerLayout not aligned -

why textview , button aren't aligned? should since have same height , there no gravity enforced. tried prepare gravity didn't work. bug?

<?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <textview android:id="@+id/tv1" android:layout_width="70sp" android:layout_height="wrap_content" android:text="my test test test test test test test test test test" android:textsize="10sp" /> <button android:id="@+id/btn1" android:layout_width="90sp" android:layout_height="wrap_content" android:text="my button 1 button button" android:textsize="10sp" /> <button android:id="@+id/btn2" android:layout_width="90sp" android:layout_height="wrap_content" android:text="my button 2 button button" android:textsize="10sp" /> <button android:id="@+id/btn3" android:layout_width="70sp" android:layout_height="wrap_content" android:text="info" android:textsize="10sp" /> </linearlayout>

it's due linearlayout baseline align here have finish explanation http://www.doubleencore.com/2013/10/shifty-baseline-alignment/

android android-layout

No comments:

Post a Comment