0
저는 이것을 오랜 시간 동안 필사적으로 시도했지만 여전히 효과가 없었습니다. ListView에서 내 어댑터 내부에서 데이터를 기반으로 이미지 뷰를 동적으로 추가하려고합니다. 그러나 ScrollView는 추가 된 이미지와 함께 표시되지 않습니다. myLinearLayout.getChildCount()를 시도했을 때 적절한 결과를 얻었습니다!HorizontalScrollView에 동적 이미지 뷰를 추가하는 Android가 작동하지 않습니다.
내가 뭘 잘못하고 있니? LinearLayout`이 나를 위해 일`모두`HorizontalScrollView`에 layout_width = "wrap_content"`및 :) :`안드로이드 적용 : 어떤 도움이 많이
<!-- ScrollView (This lies inside listView's child view) -->
<HorizontalScrollView
android:id="@+id/card_txn_horizontal_scroll"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="left">
<LinearLayout
android:id="@+id/scroll_view_linear"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal"
android:background="@color/header_bg">
</LinearLayout>
</HorizontalScrollView>
LinearLayout sharedWithView = (LinearLayout) convertView.findViewById(R.id.scroll_view_linear);
for (User sharer : data.getSharerModelList()) {
ImageView mImageView = (ImageView) mInflator.inflate(R.layout.photo, null);
Picasso.with(mImageView.getContext())
.load(expense.getPayeeModel().getProfilePicUrl())
.centerCrop()
.resize(QuickReturnUtils.dp2px(mImageView.getContext(), 38),
QuickReturnUtils.dp2px(mImageView.getContext(), 38))
.placeholder(R.drawable.ic_launcher)
.error(android.R.drawable.stat_notify_error)
.into(mImageView);
sharedWithView.addView(mImageView);
}
감사 @medhdj 내부
android:layout_width="wrap_content"
을 시도 :) 감사합니다 – user2312798