When I execute my android application it works fine, except the view will not fill up the screen. I’m using the following xml file:
<?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="fill_parent"
android:orientation="vertical"
>
<com.project.name.SplashView
android:id="@+id/splashView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
</LinearLayout>
I have a custom view defined that extends the regular view and I’m overwriting the onDraw method to display a splash screen. In code I’m setting the layout with a simple call:
setContentView(R.layout.splash);
I’m not going to post my onDraw method because it has a bunch of animation code. However, I’ve tested the view bounds by simply whiting out the background of the canvas using this function (so I know its not filling the screen):
private void drawBackground(Canvas c)
{
Paint p = new Paint();
p.setColor(Color.WHITE);
c.drawRect(0, 0, c.getWidth(), c.getHeight(), p);
}
Anyone with any ideas?
I managed to fix the problem by making sure the minSDKVersion was set to at least 8.