如何隐藏/显示我的布局的某些部分? [英] How can Hide/Show some parts of my layout?

查看:229
本文介绍了如何隐藏/显示我的布局的某些部分?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我想在我的Andr​​oid应用程序的布局隐藏和显示元素。我不喜欢这里都已经解决了,但它不能正常工作等问题得到解决:/我离开你我的code:

Hi guys I wanna hide and show elements on my android app's layout. I did like in other solved questions here have been solved but it doesn't work :/ I leave you my code:

[...]
[...]
case 3:
            int numero_info=0;
            tvnomeditta.setText(Dati_souvenir[indice_riga][0]);
            tvindirizzoditta.setText(Dati_souvenir[indice_riga][1]);



            if (Dati_souvenir[indice_riga][3].equals(""))
            {
                v.findViewById(R.id.email_icon).isShown();
            }else{
                numero_info++;
                //tvindemail.setText(Dati_souvenir[indice_riga][3]);
            }

            if (Dati_souvenir[indice_riga][4].equals(""))
            {
                tvdescrizione.setText("Descrizione non trovata");
            }else{
                numero_info++;
                tvdescrizione.setText(Dati_souvenir[indice_riga][4]);
            }

            if (numero_info <=0)
            {
                v.findViewById(R.id.links_bar).setVisibility(View.INVISIBLE);
            }

            break;
        }
        [...]
        [...]

感谢您这么多的答案。

Thank you so much for any answers.

推荐答案

隐藏其 -

v.findViewById(R.id.links_bar).setVisibility(View.GONE);

与再次显示它 -

show it again with -

v.findViewById(R.id.links_bar).setVisibility(View.VISIBLE);

numero_info&LT; = 0 从不 = TRUE

这篇关于如何隐藏/显示我的布局的某些部分?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆