我正在使用LinerLayout和一个Facebook登录按钮图像。 我想保持前50dp的保证金并保持图像为中心对齐。 当我使用以下代码时,取决于屏幕图像不在中心
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/background"
tools:context=".MainActivity" >
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/loginwithfb"
android:layout_marginTop="50dp"
android:layout_marginLeft="60dp"
/>
</LinearLayout>