【Android】ScrollView内动态添加图片间距过大的问题
16lz
2021-01-24
今天用scrollview动态添加图片时发现间距太大了,怎么调参数距离都没用。。我的原代码
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View root = inflater.inflate(R.layout.fragment_dashboard, container, false); ImageView imageView ; LinearLayout linearLayout=(LinearLayout)root.findViewById(R.id.dash_ll); for(int i=0;i
最后发现添加 imageView.setAdjustViewBounds(true); 就好了。基础知识太薄弱了,还是需要好好看书才行
更多相关文章
- android中ListView数据刷新时的同步方法
- Android显示SDCARD中的图片
- UE4填坑记之——Android打包报错
- Android(安卓)Notification基础知识
- android奇怪问题收集
- Android(安卓)bitmap序列化
- FlowLayout
- Linux入门基础知识(1)-------Linux基础概念
- Android Studio升级后报 method not found: 'runProguard'的错误