मैं एक सुंदर प्रकाश प्रारंभिक स्क्रीन प्रदर्शित करने के लिए एक रैखिक लेआउट का उपयोग कर रहा हूं। इसमें 1 बटन होता है जिसे क्षैतिज और लंबवत रूप से स्क्रीन में केंद्रित किया जाता है। हालाँकि मैं जो भी करने की कोशिश करूँगा बटन को केंद्र में संरेखित करेगा। मैंने नीचे XML को शामिल किया है, क्या कोई मुझे सही दिशा में इंगित कर सकता है?
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ImageButton android:id="@+id/btnFindMe"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|center_horizontal"
android:background="@drawable/findme"></ImageButton>
</LinearLayout>

layout_widthकि "रैप_ कॉन्टेंट" पर सेट किया जाए। बाद मेंlayout_gravityवही किया जो करना चाहिए था!