मेरे पास दो गतिविधियां हैं जो SD
कार्ड उपस्थिति के आधार पर खुलती हैं। एक गतिविधि में तीन Buttons
और TextView
और दूसरा ImageView
, एक बटन और ज़ूम नियंत्रण है। जब मैं अभिविन्यास बदलता हूं, तो क्षैतिज दिशा में बटन चारों ओर घूमते हैं। इस के आसपास कैसे जाना है?अभिविन्यास बदलते समय एक्सएमएल लेआउट परिवर्तन
मेरे 'एसडी' कार्ड लेआउट
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#1E1E1E"
android:orientation="vertical" >
<Button
android:id="@+id/button_print"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="44dp"
android:background="@drawable/my_button"
android:text="@string/print" />
<TextView
android:id="@+id/text_SDmissing"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="80dp"
android:text="@string/SDmissing"
android:textSize="20dp" />
<Button
android:id="@+id/button_camera"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/button_print"
android:layout_centerHorizontal="true"
android:layout_marginBottom="58dp"
android:background="@drawable/my_button"
android:text="@string/camera" />
<Button
android:id="@+id/button_insert"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/text_SDmissing"
android:layout_centerHorizontal="true"
android:layout_marginTop="40dp"
android:background="@drawable/my_button"
android:text="@string/insert" />
</RelativeLayout>
कृपया हमें अपने लेआउट xml फ़ाइल (रों) दिखा। –
कृपया अपनी एक्सएमएल फाइल पोस्ट करें। यदि आपको अभिविन्यास के आधार पर लेआउट बदलने की आवश्यकता है तो आपको लेआउट-पोर्ट और लेआउट-भूमि के लिए दो लेआउट सेट करना होगा। – deepa
क्या आपने पोर्ट्रेट/लैंडस्केप के लिए अलग-अलग लेआउट उपलब्ध कराने की कोशिश की है? – Luksprog