android-radiogroup

Which element do I need to modify to add padding between a drawable and its enclosed elements?

自古美人都是妖i 提交于 2019-12-11 08:52:41
问题 Based on what I learned here, I was able to add some "fences" around groupings of related widgets: But, as you can see, the second/lower box is crowding the first radio button text. Which element do I need to modify to add some space? Do I need to add something to the box itself, which lives in the drawable folder and is defined like this: <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" > <stroke android:width=

ConstraintLayout, RadioGroup and two columns of RadioButton

允我心安 提交于 2019-12-11 05:25:32
问题 I have a ConstraintLayout as a root Layout and it's fine. However I now have a RadioGroup where I have to make two columns of RadioButtons within it. Since ConstraintLayout is about getting the rid of Nested Layouts, I thought it would be fine placing those RadioButtons in the RadioGroup and place them appropriately. Turns out having a ConstraintLayout as a Root layout, Containing the RadioGroup, doesn't seem to change anything. But maybe I'm wrong. How would you guys achieve having two rows

RadioGroup and TextView in a RelativeLayout - RadioGroup is hiding TextView

依然范特西╮ 提交于 2019-12-08 12:03:59
问题 This is what am trying to accomplish. A textView and beneath that a radioButton group in which radioButtons are added programmatically. Am able to get only the radioButton group displayed with radioButtons and not the textView . radioButton group is taking up all the space in layout and textView is invisible. I have looked into numerous posts on stackoverflow.com on formatting and displaying in layout but still could not figure where am making the mistake. Could you please help me with the

RadioGroup retrieve is null

。_饼干妹妹 提交于 2019-12-08 11:43:02
问题 I try to retrieve my RADIOGROUP for check which Radio Button is checked. For this, I use this code in onCreate() : /** * @param savedInstanceState */ @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); radioGroup_LANGUE = (RadioGroup) findViewById(R.id.RadioGroup_LANGUE); radioGroup_MODE = (RadioGroup) findViewById(R.id.RGroup_ModeConnexion); ... } But I use the debug, and AndroidStudio tell me radioGroup_LANGUE is null. So I get NULLPOINTER

Display Custom drawable and text in center of radio button

◇◆丶佛笑我妖孽 提交于 2019-12-08 05:47:51
问题 I am writing an application where I need to draw two radio button in equal horizontal space. That I achieved by set android:layout_weight="1" property for both of radio button. Now I need to display custom drawable button in centre and need to place text inside of that drawable, like this: Here behaviour of both draw drawable and text is dynamic. Is there any way to achieve both things in centre. 回答1: Give a try to the following code to achieve the desired output. <?xml version="1.0" encoding

Checking RadioButton of RadioGroup in ListView checks other item button

旧巷老猫 提交于 2019-12-08 05:42:10
问题 here is adapter class..... public View getView(final int position, View convertView, ViewGroup parent) { ViewHolder holder=null; Student temp = (Student) getItem(position); if (convertView == null) { convertView = mInflator.inflate(R.layout.item_class_student, null); holder = new ViewHolder(); holder.nameTextView = (TextView) convertView.findViewById(R.id.row_student_name); holder.classTextView = (TextView) convertView.findViewById(R.id.row_student_class); holder.rollNumberTextView =

TableLayout of radiogroup(s) with respective label(s) aligned in android

一个人想着一个人 提交于 2019-12-08 02:18:40
问题 I'm creating a feedback input form which takes user selection from radio buttons just like below image. So i took a table layout and added table rows with textviews of fixed width in first row and a textview with radio buttons of fixed width for the remaining rows Here is the layout code: <HorizontalScrollView android:layout_width="match_parent" android:layout_height="wrap_content"> <TableLayout android:showDividers="middle" android:layout_width="wrap_content" android:layout_height="wrap

Checking RadioButton of RadioGroup in ListView checks other item button

半世苍凉 提交于 2019-12-06 15:36:39
here is adapter class..... public View getView(final int position, View convertView, ViewGroup parent) { ViewHolder holder=null; Student temp = (Student) getItem(position); if (convertView == null) { convertView = mInflator.inflate(R.layout.item_class_student, null); holder = new ViewHolder(); holder.nameTextView = (TextView) convertView.findViewById(R.id.row_student_name); holder.classTextView = (TextView) convertView.findViewById(R.id.row_student_class); holder.rollNumberTextView = (TextView) convertView.findViewById(R.id.row_student_roll_number); holder.image = (ImageView) convertView

TableLayout of radiogroup(s) with respective label(s) aligned in android

时间秒杀一切 提交于 2019-12-06 05:46:29
I'm creating a feedback input form which takes user selection from radio buttons just like below image. So i took a table layout and added table rows with textviews of fixed width in first row and a textview with radio buttons of fixed width for the remaining rows Here is the layout code: <HorizontalScrollView android:layout_width="match_parent" android:layout_height="wrap_content"> <TableLayout android:showDividers="middle" android:layout_width="wrap_content" android:layout_height="wrap_content"> <TableRow> <TextView android:id="@+id/name" android:layout_width="100dp" android:layout_height=

Android: custom layout for Radio Group

耗尽温柔 提交于 2019-12-06 01:04:27
I'm trying to create a 2x2 array of radio buttons, but I don't know how to customize layout other than horizontal or vertical. Any ideas? I've only gotten A B C D and A B C D but I want to have A B C D EDIT: I resolved this issue. For anyone wondering, I set up two individual radio groups (i.e. one with AB and one with CD). I set onClickListener() for each RadioButton, and used clearCheck() on the second RadioGroup when a button in the first RadioGroup was clicked, and vice versa. You can easily do it by including two LinearLayout into your RadioGroup with a orientation="horizontal" .