如何设置单选按钮的可见性属性 [英] how can i set visibility property of radiobutton

查看:632
本文介绍了如何设置单选按钮的可见性属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在xamarin与单选问题。我想使我的单选按钮可见的,但我不知道如何做到这一点。我的单选按钮在我的xml文件不可见。我想使他们从code可见。我需要这个,因为我想让上次登录的用户的列表,当我选择其中一个,他填补我的箱子。但在开始我没有3个用户,但只有1,所以我需要隐藏不使用单选按钮。那么,如何可以改变我的单选按钮的财产?

I have problem with RadioButton in xamarin. I would like to make my RadioButtons visible but I don't know how to do this. My RadioButtons are invisible in my xml file. I would like to make them visible from code. I need this because I want to make a list of the last logon users and when I choose one he fill my boxes. But on start I dont have 3 users but only 1 so I need to hide not used RadioButtons. So how can I change property of my RadioButtons?

推荐答案

要做出一个单选按钮可见:

To make a radio button visible:

radioButton.setVisibility(View.VISIBLE);

要做出一个单选按钮无形的:

To make a radio button invisible:

radioButton.setVisibility(View.GONE);

这工作正常presuming你已经正确初始化单选的活动。

This works fine presuming you have correctly initialized radioButton in Activity.

有关Xamarin.Android C#试试这个:

For Xamarin.Android C# try this:

button.Visibility = ViewStates.Invisible;

参考链接1 参考链接2

这篇关于如何设置单选按钮的可见性属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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