This is more of an opinion based question.
I'm working on an app that will give the user a choice of 2 items of which the user must choose one. Now to implement this, we have :-
RadioButtons in a RadioGroup
Spinner
For such a basic thing, I think I can should go with RadioButton but they don't look much aesthetically pleasing as much a Spinner looks but a Spinner is basically used for more than 2 items generally.
So I'm all confused as what would be better UI/UX wise.
Can someone please help me out on this one?
For two options, why not use a Toggle Button?
http://developer.android.com/guide/topics/ui/controls/togglebutton.html
Related
We're making an app that can make surveys which is to be answered, of course.
But i'm not sure if it is possible that, for example, we will display all the list of inserted survey topics
and that in every topic, there'll be 1 button for each, generated individually ( sorry for the term. not really good in English. ) so that they can select it.
I'm also hoping to use it in the list of questions so that they can select from given answers using those buttons.
If it is possible, can you please give me some hints/starting lines how to make it?
Thanks in advance.
I think you need to overview ListView widget of Android first.
It helps to show lists you want.
And after you need to research Adapter you need. It is interface you must implement to use with ListView.
I'm searching for a widget in a android app where the user can select a item from a specific list. it's only possible to select one and the list is defined by the app.
it's like a dropdown. I can't use a simple listView because I need at least 4 of there controls on one page. so what is a good solution?
I think, you are looking for something like Spinners
Spinners is what you are looking for.
You can use Spinner in android for dropdown.or you can use AlertDialog as like that of drodown.For using spinner read this.For using AlertDialog read this
Assuming some logic that deals with measure units and the user is asked to choose between US and metric systems, what would be the better UI choice: using 2 CheckBoxes or RadioButtons? Is there an easy way to ensure just one View is checked?
Checkboxes are useful when you want the user to select multiple options.
Radio buttons are useful to guarantee a single option among multiple options. However, if you have a fair amount of radio buttons the user interface becomes a mess. Therefore, for those cases, Spinners are the best answer for your problem.
If you use Radio Buttons you can guarantee they only use one radio button using RadioGroups.
I would use a Spinner if I were you. It'll allow you to add other unit systems in the future.
Through radio button group you can do it. Just use a RadiobuttonGroup widget mention your radiobutton properties.
Simple. If you can't follow some of procedures I suggest going and look for tuts on them
First: Go to your xml file
Second: Create Radio group
Third: Create Radio button in between
Forth: make sure you have the id of the radio button.
fifth: call the item on your main class. RadioButton name = (RadioButton)findViewById(R.id.radioButton Name);
Now you can program the rest everything really just follows this order for anything in .xml. You need it call it and create and ID simple. Next time just look at youtube vids. I recommend the website TheNewBoston.org best tuts you'll ever encounter in a life time for almost all programming languages.
I am using checkbox in android and the state of checkbox is changing once i click on the text of the checkbox. "[CB] Text ". Is there any way to change this behaviour so that the state of checkbox will be changed once i click on the box and not the text.
Sorry this question would have already asked in the forum. But i was not able to find any queries related to this. Any suggestions would be really helpful for me.
-Thanks,
Ron...
The answer by jkhouw1 is the only way I can think of as well.
But please take a moment to make sure you really want this functionality. Every time you change the basic behavior of a, to the user, well know element you confuse more than you help. There are cases where you need such a change, but take a minute to make sure this is so!
Other than creating your own control, the easiest way would probably be to not display any text with the checkbox and in your layout use a textview for the text instead so you would have
[CB][TextView]
I think you are using [checkbox] [textview] in one layout tht is linear or relative,if i am right then set android:focusable = "false" android:clickable= "true" to checkbox.
i hope it will help you.
Goal: have a LIstView show a list of text strings. The user can select an item by touching it. The selected item is visibly different to those not selected.
In short I want to have a simple scrolling list box that works using trackballs AND touch mode.
There are many posts asking for this, but none seem to get an adequate answer. This is such a simple requirement, why is there no article on this?
I looked at http://developer.android.com/resources/tutorials/views/hello-listview.html but that won't work in touch mode: the orange background is displayed, something unachievable in touch mode without extreme geek wizadry, for something that is quite frankly what all newbies expect out of the box.
I suspect that the only way to achive a touch mode selectable listbox (ListView in google speak), is to stick radio buttons in there. All of a sudden my little text list view is beccoming a monster.
Can anyone explain the simplest way to do a single choice ListView that displays the item selected so the user can figure out that it is selected, in touch mode? After fumbling for days, I really am not fussed if it has radio buttons, singing cockatoos, or whatever, so long as it's simple to code.
Here's the example that Google provides:
http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/view/List10.html
It uses radio buttons
Wat do u want to do? Just highlighting the row in the ListView which is selected.rt? for this u can use this.
android:listSelector="#drawable/highlighter"
android:drawSelectorOnTop="true"
Write this code in your XML file