使用android.support.v4.app.ListFragment时,列表的背景颜色在滚动时变为白色;

使用android.support.v4.app.ListFragment时,列表的背景颜色在滚动时变为白色;,第1张

概述我正面临一个严峻的问题.我正在尝试在滚动时更改列表的背景颜色(透明)但无法执行此 *** 作.我尝试通过xml的listView以及代码进行更改.但在两个条件列表背景变成白色.我正在使用 android.support.v4.app.ListFragment;和FragmentPagerAdapter. 我想更改列表滚动时间颜色更改.为此我正在使用以下代码. public static class Arr 我正面临一个严峻的问题.我正在尝试在滚动时更改列表的背景颜色(透明)但无法执行此 *** 作.我尝试通过xml的ListVIEw以及代码进行更改.但在两个条件列表背景变成白色.我正在使用 android.support.v4.app.ListFragment;和FragmentPagerAdapter.

我想更改列表滚动时间颜色更改.为此我正在使用以下代码.

public static class ArrayListFragment extends ListFragment {    int mNum;    /**     * Create a new instance of CountingFragment,provIDing "num"     * as an argument.     */    static ArrayListFragment newInstance(int num) {        ArrayListFragment f = new ArrayListFragment();        // Supply num input as an argument.        Bundle args = new Bundle();        args.putInt("num",num);        f.setArguments(args);        return f;    }    /**     * When creating,retrIEve this instance's number from its arguments.     */    @OverrIDe    public voID onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        mNum = getArguments() != null ? getArguments().getInt("num") : 1;    }    /**     * The Fragment's UI is just a simple text vIEw showing its     * instance number.     */    @OverrIDe    public VIEw onCreateVIEw(LayoutInflater inflater,VIEwGroup container,Bundle savedInstanceState) {        VIEw v = inflater.inflate(R.layout.fragment_pager_List,container,false);        //v.setBackgroundResource(R.drawable.background);        VIEw tv = v.findVIEwByID(R.ID.text);        ((TextVIEw)tv).setText(framename());        return v;    }   // @OverrIDe    public voID onActivityCreated(Bundle savedInstanceState) {        super.onActivityCreated(savedInstanceState);        setlistadapter(new ArrayAdapter<String>(getActivity(),androID.R.layout.simple_List_item_checked,RishavArrayList() ));    }

请告诉我如何在运行时更改滚动列表的背景?谢谢.

解决方法 请查看Google的 this blog post,特别是与XML有关的部分;
androID:cachecolorHint="#00000000"
总结

以上是内存溢出为你收集整理的使用android.support.v4.app.ListFragment时,列表的背景颜色在滚动时变为白色;全部内容,希望文章能够帮你解决使用android.support.v4.app.ListFragment时,列表的背景颜色在滚动时变为白色;所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/web/1136713.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-30
下一篇2022-05-30

发表评论

登录后才能评论

评论列表(0条)

    保存