मैं 6 बटन के साथ एक लेआउट बनाने की कोशिश कर रहा हूं जो स्वचालित रूप से स्क्रीन के आकार को विंडोज फोन की टाइल के रूप में अनुकूलित करता है। कोड में मैं लाइन के लिए गतिशील रूप से 6 बटन, 2 बना देता हूं लेकिन बटन को बाद वाले भरने वाली स्क्रीन के आकार में फिट होना चाहिए। मैं कैसे आगे बढ़ सकता हूं?विंडोज टाइल्स जैसे 6 बटन के साथ लेआउट कैसे बनाएं
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dip"
android:orientation="horizontal"
android:weightSum="2" >
<Button
android:layout_width="0dip"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/conv_up" />
<Button
android:layout_width="0dip"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/conv_up"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dip"
android:orientation="horizontal"
android:weightSum="2" >
<Button
android:layout_width="0dip"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/conv_up"
/>
<Button
android:layout_width="0dip"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/conv_up"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dip"
android:orientation="horizontal"
android:weightSum="2" >
<Button
android:layout_width="0dip"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/conv_up"
/>
<Button
android:layout_width="0dip"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/conv_up"
/>
</LinearLayout>
रखो अब तुम क्या देखते हैं, और आप क्या उम्मीद करते हैं। अन्यथा जवाब देना मुश्किल होगा। – Siddharth
मैं कुछ भी नहीं देख सकता क्योंकि यह कोड मुझे यह त्रुटि देता है: "संदिग्ध आकार: यह दृश्य अदृश्य कर देगा, लेआउट_वेट के साथ प्रयोग किया जाना चाहिए" LinearLayout एंड्रॉइड पर: layout_height = "0dip" – bisemanu
'0dip' मुद्दा है। – Siddharth