Reputation: 181
I published my app to the play store. Fits SGSII Epic 4.5", LG Optimus V 3.2", LG Optimus Black 4.0", Evo shift 3.6" mytouch 4g 3.8", but it doesn't fit droid bionic 4.3". Anybody know why it doesn't fit to the screen? The screen size is 4.3" but the app only takes up room for a 3.6" screen on the 4.3" screen. Also samsung infuse 4g when tilted to the side it try's to going into landscape mode, and i have it set to android:screenOrientation="portrait" in the manifest
This is my main xml
android:layout_width="320dp"
android:layout_height="485dp"
android:orientation="vertical"
android:padding="15dp"
android:background="@drawable/graybkg"
>
<Button
android:id="@+id/national"
android:layout_width="300dp"
android:layout_height="120dp"
android:layout_gravity="center"
android:background="@drawable/custtomnatbut"
/>
<Button
android:id="@+id/yorgeys"
android:layout_width="300dp"
android:layout_height="120dp"
android:layout_gravity="center"
android:background="@drawable/custtomyorgeys"
/>
android:layout_width="300dp"
android:layout_height="60dp"
android:layout_gravity="center"
android:background="@drawable/custtomfoursq"
/>
<LinearLayout
android:layout_width="300dp"
android:layout_height="60dp"
android:layout_gravity="center"
>
<Button
android:id="@+id/facebook"
android:layout_width="150dp"
android:layout_height="60dp"
android:background="@drawable/custtomface"
/>
<Button
android:id="@+id/website"
android:layout_width="150dp"
android:layout_height="60dp"
android:background="@drawable/custtom_web"
/>
</LinearLayout>
Upvotes: 0
Views: 310
Reputation: 91361
You should really not be thinking about screens as physical screen sizes. What matters for layout is the number of dp units on the screen.
I believe the Droid Bionic is a qHD (960x540) screen running at hdpi. In terms of dp units, this is 640x360dp. Compare this to the typical HVGA (800x480) hdpi which is 533x320dp.
The layouts you have shown seem to be written with absolute sizes plugged in for everything. If this is what you are doing, you are doomed. You can't write like there is One True Screen Size To Rule Them All. The reason you are writing layouts is to describe your UI so the platform can move its elements around to fit to the screen. Trying to force this into being a fixed positioning system is going to result you fighting with the system, and ultimately being buried in trying to support another and yet another variation in screen size.
Consider that the Galaxy Nexus and other newer phones coming out are 1280x800 xhdpi screens, which gives you yet another size -- 640x400dp.
Upvotes: 7