Sunday, July 18, 2010

App crash when setting layout_weight without layout_width

While playing with the layout on Android I encountered the following weird problem: when using "android:layout_weight" attribute for an element without "android:layout_width" attribute it works just fine in the emulator but on the real phone it crash (Nexus One, Android 2.2).

Since using "android:layout_width" gives me unwanted results I've tried to work around this issue and found the following solution:
android:layout_width="0dip"

No comments: