Android应用程式中的setVisibility [英] setVisibility in android app
本文介绍了Android应用程式中的setVisibility的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
String[] prefArray = getResources().getStringArray(R.array.list_dailyshake);
switch(v.getId()) {
case R.id.buttonprevious:
if(pageindex!=0)
{
btnprevious.setVisibility(View.VISIBLE);
btnnext.setVisibility(View.VISIBLE);
pageindex=pageindex-1;
M_getdata();
}
else
{
btnprevious.setVisibility(View.GONE);
}
break;
case R.id.buttonnext:
if(pageindex+1!=prefArray.length)
{
pageindex=pageindex+1;
M_getdata();
btnnext.setVisibility(View.VISIBLE);
btnprevious.setVisibility(View.VISIBLE);
}
else
{btnnext.setVisibility(View.GONE);}
break;
}
推荐答案
转到xml文件
转到您的工具,右键单击=>属性=>可见性并标记不可见
或
您可以编写android:visibility ="invisible"
并为事件设置可见性setVisiblity(true)...
逻辑就是你了...
Go to xml file
Go to your tool right click => property => visibility and tick on invisible
OR
you can write android:visibility="invisible"
and for visibility setVisiblity(true) on event...
and logic is yours...
如果你是android开发人员,请检查
btnprevious.setVisibility(true);
喜欢它是否起作用.
谢谢
are you android developer if yes then check
btnprevious.setVisibility(true);
like that its working or not.
Thanks
这篇关于Android应用程式中的setVisibility的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文