Как я могу раздуть мой другой вид на мой linearlayout? Лучше сначала показать мой макет.Надуть вид LinearLayout
list.xml
<FrameLayout >
<ImageView/>
<ProgressBar />
</FrameLayout>
<TextView/>
<TextView />
тогда main.xml
<HorizontalScrollView
android:id="@+id/hscrollview"
android:layout_width="wrap_content"
android:layout_height="40dip"
android:layout_marginTop="50dip"
android:background="#000000"
android:scrollbars="none" >
<LinearLayout
android:id="@+id/linear_temp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal" >
</LinearLayout>
</HorizontalScrollView>
Итак, я хочу, чтобы мои list.xml
для заполнения linearlayout
. Данные моего list.xml
от моего json. Я потратил много времени на изменение моей реализации.
Я попытался сделать это: (я первый игнорировать изображение) не отображается
//after parsing json and
//and doing this..
product = new ProductRowItem(imageUrl, sName, productId, desc, Integer.parseInt(imgHeight), Integer.parseInt(imgWidth), productOwnerId);
productItems.add(product);
//...
//by the way, product item is a pojo..
for(ProductRowItem product : productItems){
View productView = inflater.inflate(R.layout.product_list_layout, null);
holder = new ViewHolder();
holder.txtProductName = (TextView) productView.findViewById(R.id.product_name);
holder.txtProductDesc = (TextView) productView.findViewById(R.id.product_desc);
productView.setTag(holder);
holder.txtProductName.setText(product.getProductName());
holder.txtProductDesc.setText(product.getProductDesc());
}
Ничего ... Любые идеи о раздувании в LinearLayout очень ценится. Заранее спасибо .. Кроме того, я уже использовал HorizontalListView. И у меня есть причина, почему я не буду использовать это. Не то, чтобы это плохо, но я не могу переопределить и нет метода overscrollBy
«Вы раздуваете представление, но не добавляете« productView », созданный на ваш основной вид или в групповом виде, отображаемом на вашем основном экране!» извините, я этого не понял .. – elL
Что вы делаете с "productview" после инструкции "for"? – VincentLamoute