You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Can it be possible to make image width to match_parent( same as device width) when there is only one image in list? I just apply below code but no luck.
int imgWidth = width[0] * (int) mContext.getResources().getDisplayMetrics().density;
int imagHeight = height[0] * (int) mContext.getResources().getDisplayMetrics().density;
int height = (deviceWidth * imagHeight) / imgWidth;
holder.imageView.getLayoutParams().height = height;
holder.imageView.getLayoutParams().width = deviceWidth;
The text was updated successfully, but these errors were encountered:
The-RobinHood
changed the title
width match_parent single image.
when single image make width to match_parent.
Apr 8, 2016
Return bigger aspectRatio when your itemList(your data array) count is 1.
@Override
public double aspectRatioForIndex(int index) {
// ...
if (mData.size() == 1) return 10.0; //10 is just example, can be smaller or bigger
// ...
}
Hello,
Can it be possible to make image width to match_parent( same as device width) when there is only one image in list? I just apply below code but no luck.
The text was updated successfully, but these errors were encountered: