I've been trying for ages to figure this out, how to add an imageview on code and set its width to match_parent and height to wrap_content.
I've tried many things but I keep getting class cast exception
ParallaxListView pListView = (ParallaxListView) getActivity().findViewById(R.id.prods_list);
ImageView iv = new ImageView(getActivity());
LinearLayout.LayoutParams parms = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
iv.setLayoutParams(parms);
iv.setAdjustViewBounds(true);
RequestCreator picassoRequest = Picasso.with(getActivity()).load("http://www.colonialgeneral.com/images/convenience-store.jpg").error(R.drawable.error);
picassoRequest.into(iv);
I've been trying for ages to figure this out, how to add an imageview on code and set its width to match_parent and height to wrap_content. I've tried many things but I keep getting class cast exception
and my fragment_list.xml
<com.nirhart.parallaxscroll.views.ParallaxListView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/prods_list" android:layout_width="match_parent" android:layout_height="match_parent" app:parallax_factor="1.9" tools:context=".MainActivity$FragmentProds" />