我的设想是:
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:scrollbars="vertical"
android:background="#ffffeb">
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="10dp">
// Other stuff in between here..
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:paddingLeft="12dp"
android:paddingRight="12dp">
<Button
android:id="@+id/insert_ad_ad_information_category_and_type_button"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:text="@string/insert_ad_ad_information_category_and_type_button"/>
<ListView
android:id="@+id/insert_ad_ad_information_parameters_frame"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#ffffeb"
android:cacheColorHint="#00000000"
android:divider="#00000000"
android:dividerHeight="0dp"
android:scrollbars="none"
android:listSelector="@android:color/transparent"/>
The problem I have is that I can t get my ListView
to get the right height that I want.
I ll add a couple of components with my custom BaseAdapter
class and everything there works as intended.
But when I then debug my application I can only see 1,5 out of 3 components in the list and the rest is hidden further down in the ListView
.
But how can I make my ListView
calculate how many components I have and get it to show all my components directly without having too scroll down?
另一种想法是,如果我能把任何其他观点与我的<代码”联系起来。 BaseAdapter ? 由于唯一的原因,我使用<代码>ListView是因为采用了setAdapter(
)。
赞赏所有想法和意见: