I am creating a application for android, wherein i am facing one strange kind of problem. The problem is that I’ve positioned the button in the center of the screen which is shown the same way in the GRAPHICAL LAYOUT of the file, but when i run the application in emulator the button is positioned more towards the right side and not centered. Can anyone point out the problem.
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:panel="http://schemas.android.com/apk/res-auto"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#CCC"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<org.miscwidgets.widget.Panel
android:id="@+id/mytopPanel"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingBottom="4dip"
panel:animationDuration="1000"
panel:closedHandle="@drawable/top_switcher_collapsed_background"
panel:content="@+id/mypanelContent"
panel:handle="@+id/mypanelHandle"
panel:linearFlying="true"
panel:openedHandle="@drawable/top_switcher_expanded_background"
panel:position="top" >
<Button
android:id="@+id/mypanelHandle"
android:layout_width="fill_parent"
android:layout_height="33dip"
android:paddingRight="50dp" />
<LinearLayout
android:id="@+id/mypanelContent"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<EditText
android:id="@+id/editTextUserName"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_margin="3dp"
android:layout_marginTop="6dp"
android:hint="@string/editUserName" >
</EditText>
<EditText
android:id="@+id/editTextPassword"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_margin="3dp"
android:hint="@string/editUserPwd" >
</EditText>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#323299"
android:gravity="center"
android:padding="4dip"
android:text="@string/drpDwnTxt"
android:textColor="#eee"
android:textSize="16dip"
android:textStyle="bold" />
</LinearLayout>
</org.miscwidgets.widget.Panel>
<EditText
android:id="@+id/editTextNumber"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_margin="3dp"
android:layout_marginTop="6dp"
android:hint="@string/editNumber" >
</EditText>
<EditText
android:id="@+id/editTextMessage"
android:layout_width="fill_parent"
android:layout_height="100dp"
android:layout_margin="3dp"
android:hint="@string/editPwd" >
</EditText>
<Spinner
android:id="@+id/spinnerGateway"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:drawSelectorOnTop="true"
android:entries="@array/spinnerList"
android:prompt="@string/spinnerPrompt" />
<Button
android:id="@+id/btnSend"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_margin="3dp"
android:onClick="save"
android:text="@string/StrbtnSend" >
</Button>
</LinearLayout>
</FrameLayout>

This new layout file has done the job for me, just one small error was creating the trouble.