लेआउट वजन के बारे में पढ़ें - http://developer.android.com/guide/topics/ui/layout-objects.html
तीन दृश्य है और 0, 1 और 0 के लिए वजन सेट करते हैं - तो बीच दृश्य का आकार बदलेंगे, अन्य दो एक निश्चित आकार रहना होगा तो यह एक है एक आकार बदलने के लिए शीर्षलेख & पाद लेख जोड़ने के लिए अच्छा समाधान। इस टेम्पलेट कोड को आज़माएं, और ध्यान दें कि लेआउट भार कैसे निर्धारित किए जाते हैं:
<?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">
<!-- Header -->
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="0"
/>
<!-- Map -->
<MapView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
....
/>
<!-- Footer, or another embedded Layout -->
<ImageView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="0"
/>
</LinearLayout>
स्रोत
2011-03-23 10:35:13
सबसे पहले आपकी प्रतिक्रिया के लिए धन्यवाद यह बहुत अच्छी तरह से काम करता है। इसके अलावा मैं आज सिर्फ 15 प्रतिष्ठा तक पहुंच गया, इसलिए अब से मैं एक उपयोगी के रूप में जवाब टिक सकता हूं :) –