मेरे पास दो बटन हैं जो मैं क्षैतिज रूप से साइड-साइड दिखाई देना चाहता हूं, लेकिन साथ में वे फोन की क्षैतिज लंबाई भरते हैं। ऊंचाई रैप सामग्री है, यह ठीक है। मेरा मुद्दा अभी यह है कि केवल एक बटन दिखा रहा है (स्क्रीन पर फैला हुआ है)।एंड्रॉइड बटन लेआउट - पूरे स्क्रीन पर दो बटन साइड-बाय-साइड प्राप्त करें
यहाँ मेरी एक्सएमएल कोड है:
<LinearLayout
android:id="@+id/page_buttons"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
>
<Button
android:id="@+id/prevButton"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Previous"
/>
<Button
android:id="@+id/nextButton"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Next"
/>
स्क्रीन पर दो बटन दिखाई देने की अपेक्षा आप कैसे करते हैं, यह देखते हुए कि आपने xml में केवल एक निर्दिष्ट किया है? क्या आप गतिशील रूप से दूसरा बना रहे हैं और इसे रैखिक लेआउट में जोड़ रहे हैं? – asenovm
मैंने पोस्ट को अब इसे पठनीय बनाने के लिए संपादित किया। – JDS