मैं शीर्ष पर एक शीर्षक पट्टी और नीचे नेविगेशन बार के साथ एक गतिविधि बनाना चाहता हूं। मैंने शीर्षक लेआउट लेआउट और नेविगेशन बार लेआउट को मुख्य लेआउट में शामिल करने के लिए include
का उपयोग किया जैसा कि आप नीचे देख सकते हैं। नतीजा यह है कि टाइटल बार और नेविगेशन बार दोनों स्क्रीन के शीर्ष पर जाते हैं। क्या कोई मुझे बता सकता है क्यों? धन्यवाद!RelativeLayout में मेरे शामिल होने में क्या गलत है?
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/home_widget" android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/background">
<include android:id="@+id/title_bar" layout="@layout/title_bar"
android:layout_alignParentTop="true" />
<include android:id="@+id/navigation_bar" layout="@layout/navigation_bar"
android:layout_alignParentBottom="true"/>
</RelativeLayout>
[संपादित करें] मैं मूल कारण नहीं मिला। लेकिन निम्नलिखित कार्य:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/home_widget"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/background">
<RelativeLayout android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:id="@+id/title_bar" >
<include layout="@layout/title_bar" />
</RelativeLayout>
<RelativeLayout android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:id="@+id/navigation_bar" >
<include layout="@layout/navigation_bar" />
</RelativeLayout>
आप एक relativelayout में हैं, मुझे लगता है कि आप एंड्रॉयड भूल: अपने नेविगेशन बार – Sephy
के लिए layout_below = "@ आईडी/title_bar" अपने प्रश्न 'रेस/लेआउट/title_bar की सामग्री को दिखाने के लिए अपडेट करें .xml' और 'res/layout/navigation_bar.xml', फिर @ me back। – CommonsWare