开发者

Android,Custom ListView not showing off correctly the Text

开发者 https://www.devze.com 2023-03-02 21:10 出处:网络
I have a custom LisView, in this ListView for each line I have a TextView and Imageview how c开发者_StackOverflowould i make each line of my ListView Higher ??

I have a custom LisView, in this ListView for each line I have a TextView and Imageview

how c开发者_StackOverflowould i make each line of my ListView Higher ??

Thanks for Helping!!!


You can make use of class ViewHolder

private class ViewHolder {
        TextView title1;
        ImageView image1;
    }

This in getView() method:

LayoutInflater inflater = LayoutInflater.from(getContext());
            convertView = inflater.inflate(yourLayoutFile, parent, false); 

By using this class and your custom xml file, you will be able to make your line of listview higher

0

精彩评论

暂无评论...
验证码 换一张
取 消