قرار دادن لیست ویو در اسکرول ویو !
واقعا فکر نمیکردم اینقدر داستان بشه !
میخوام یه لیست یو رو داخل اسکرول ویو قرار بدم ، و لیست ویو رو fill parent کنم ، و اسکرول ویو هم fil parent هست
اما زمان اجرا scroll view wrap content میشه ! ، در نتیجه لیست ویو کوچیک دیده میشه
گفتنش با متن سخته لطفا شما تست کنید ببینید میشه یه لیست ویو رو داخل اسکرول ویو قرار بدید که fillparent باشن ، قطعا متوجه مشکل میشید
مشکلم حل شد ، ممنون بچه ها
باید هر لایه ای رو که میخوایم به بالا یا پایین لیست ویو اضافه کنیم ، تو یه فایل XML جدا قرار بدیم بعد با اینفلیتور بچسبونیمش به لیست ویو
ListView catList = (ListView) findViewById(R.id.catList); catList.addHeaderView(G.inflater.inflate(R.layout.listviewheader, null));
میگم من آخر هدفت رو از این کار نفهمیدم. تو میخواستی یه تعداد کنترل بالای یه لیست ویو بذاری؟
اگه این بود که خیلی راخت میشد این کارو کرد
مثلا این کد مربوط به یه xml ه که یه لیست ویو داره و بالای اون لیست ویو یه اسکرول ویو هست که توی اون اسکرول ویو یه تعداد کنترل هست
<?xml versi encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" android:orientati >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="100dip" android:orientati >
<ScrollView
android:id="@+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="fill_parent" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent" android:orientati >
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button" />
<CheckedTextView
android:id="@+id/checkedTextView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="CheckedTextView" />
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Medium Text"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Medium Text"
android:textAppearance="?android:attr/textAppearanceMedium" />
<CheckBox
android:id="@+id/checkBox1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="CheckBox" />
</LinearLayout>
</ScrollView>
</LinearLayout>
<ListView
android:id="@+id/lv_name"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<!-- Preview: listitem=@android:layout/simple_list_item_1 -->
</ListView>
</LinearLayout>
پاسخگویی و مشاهده پاسخ های این سوال تنها برای اعضای ویژه سایت امکان پذیر است .
چنانچه تمایل دارید به همه بخش ها دسترسی داشته باشید میتوانید از این بخش لایسنس این آموزش را خریداری نمایید .