In radio button control how to achieve Text before radio circle?












2















What I have



enter image description here



I want to achieve something like this:



enter image description here



This is the reference link that I have used to create radio button existing control: https://github.com/kirtisagar/XamarinFormsRadioButtonXAML



.Xaml Page:



<radio:BindableRadioGroup
Spacing="10"
x:Name="DeviceConditionRadio"
ItemsSource="{Binding DeviceConditionList}"/>


.CS page:



here I have added Item source of radio:



DeviceConditionList is a List<string>()



 DeviceConditionList.Add("This device works well");
DeviceConditionList.Add("This device is not working properly");


How to get this kind of design?
Any help regarding this appreciated.!
Thanks.










share|improve this question

























  • How did u code it? You have to provide us ur code

    – Csharpest
    Jan 2 at 9:31











  • Can you provide the code you used for what you have, please? We can them possibly help you with what you need.

    – Tom
    Jan 2 at 9:48











  • @Csharpest this is what I have referred to create radio button: github.com/kirtisagar/XamarinFormsRadioButtonXAML/tree/master/…

    – MShah
    Jan 2 at 10:12











  • @Tom please find the reference link from my previous comment.

    – MShah
    Jan 2 at 10:13











  • @MShah Ok, but what have you written? How did you code your "What I have" section?

    – Tom
    Jan 2 at 10:29
















2















What I have



enter image description here



I want to achieve something like this:



enter image description here



This is the reference link that I have used to create radio button existing control: https://github.com/kirtisagar/XamarinFormsRadioButtonXAML



.Xaml Page:



<radio:BindableRadioGroup
Spacing="10"
x:Name="DeviceConditionRadio"
ItemsSource="{Binding DeviceConditionList}"/>


.CS page:



here I have added Item source of radio:



DeviceConditionList is a List<string>()



 DeviceConditionList.Add("This device works well");
DeviceConditionList.Add("This device is not working properly");


How to get this kind of design?
Any help regarding this appreciated.!
Thanks.










share|improve this question

























  • How did u code it? You have to provide us ur code

    – Csharpest
    Jan 2 at 9:31











  • Can you provide the code you used for what you have, please? We can them possibly help you with what you need.

    – Tom
    Jan 2 at 9:48











  • @Csharpest this is what I have referred to create radio button: github.com/kirtisagar/XamarinFormsRadioButtonXAML/tree/master/…

    – MShah
    Jan 2 at 10:12











  • @Tom please find the reference link from my previous comment.

    – MShah
    Jan 2 at 10:13











  • @MShah Ok, but what have you written? How did you code your "What I have" section?

    – Tom
    Jan 2 at 10:29














2












2








2








What I have



enter image description here



I want to achieve something like this:



enter image description here



This is the reference link that I have used to create radio button existing control: https://github.com/kirtisagar/XamarinFormsRadioButtonXAML



.Xaml Page:



<radio:BindableRadioGroup
Spacing="10"
x:Name="DeviceConditionRadio"
ItemsSource="{Binding DeviceConditionList}"/>


.CS page:



here I have added Item source of radio:



DeviceConditionList is a List<string>()



 DeviceConditionList.Add("This device works well");
DeviceConditionList.Add("This device is not working properly");


How to get this kind of design?
Any help regarding this appreciated.!
Thanks.










share|improve this question
















What I have



enter image description here



I want to achieve something like this:



enter image description here



This is the reference link that I have used to create radio button existing control: https://github.com/kirtisagar/XamarinFormsRadioButtonXAML



.Xaml Page:



<radio:BindableRadioGroup
Spacing="10"
x:Name="DeviceConditionRadio"
ItemsSource="{Binding DeviceConditionList}"/>


.CS page:



here I have added Item source of radio:



DeviceConditionList is a List<string>()



 DeviceConditionList.Add("This device works well");
DeviceConditionList.Add("This device is not working properly");


How to get this kind of design?
Any help regarding this appreciated.!
Thanks.







xamarin xamarin.forms






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 2 at 10:35







MShah

















asked Jan 2 at 9:07









MShahMShah

52610




52610













  • How did u code it? You have to provide us ur code

    – Csharpest
    Jan 2 at 9:31











  • Can you provide the code you used for what you have, please? We can them possibly help you with what you need.

    – Tom
    Jan 2 at 9:48











  • @Csharpest this is what I have referred to create radio button: github.com/kirtisagar/XamarinFormsRadioButtonXAML/tree/master/…

    – MShah
    Jan 2 at 10:12











  • @Tom please find the reference link from my previous comment.

    – MShah
    Jan 2 at 10:13











  • @MShah Ok, but what have you written? How did you code your "What I have" section?

    – Tom
    Jan 2 at 10:29



















  • How did u code it? You have to provide us ur code

    – Csharpest
    Jan 2 at 9:31











  • Can you provide the code you used for what you have, please? We can them possibly help you with what you need.

    – Tom
    Jan 2 at 9:48











  • @Csharpest this is what I have referred to create radio button: github.com/kirtisagar/XamarinFormsRadioButtonXAML/tree/master/…

    – MShah
    Jan 2 at 10:12











  • @Tom please find the reference link from my previous comment.

    – MShah
    Jan 2 at 10:13











  • @MShah Ok, but what have you written? How did you code your "What I have" section?

    – Tom
    Jan 2 at 10:29

















How did u code it? You have to provide us ur code

– Csharpest
Jan 2 at 9:31





How did u code it? You have to provide us ur code

– Csharpest
Jan 2 at 9:31













Can you provide the code you used for what you have, please? We can them possibly help you with what you need.

– Tom
Jan 2 at 9:48





Can you provide the code you used for what you have, please? We can them possibly help you with what you need.

– Tom
Jan 2 at 9:48













@Csharpest this is what I have referred to create radio button: github.com/kirtisagar/XamarinFormsRadioButtonXAML/tree/master/…

– MShah
Jan 2 at 10:12





@Csharpest this is what I have referred to create radio button: github.com/kirtisagar/XamarinFormsRadioButtonXAML/tree/master/…

– MShah
Jan 2 at 10:12













@Tom please find the reference link from my previous comment.

– MShah
Jan 2 at 10:13





@Tom please find the reference link from my previous comment.

– MShah
Jan 2 at 10:13













@MShah Ok, but what have you written? How did you code your "What I have" section?

– Tom
Jan 2 at 10:29





@MShah Ok, but what have you written? How did you code your "What I have" section?

– Tom
Jan 2 at 10:29












1 Answer
1






active

oldest

votes


















1














from the shared link, the default style is Title right and Image left.And the project is based on Custom renderer to do that. You can find the renderer here.
enter image description here
so you can modify this style by renderer.In the shared project not custom RadioButton
in Android and Button in IOS.Then you need custom in each of them.



Android :you can modify xml to exchange the title and image of RadioButton like this:



  <RadioButton
android:id="@+id/button1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:button="@null"//set null
android:checked="true"
android:drawableRight="@android:drawable/btn_radio"//reset the image
android:paddingLeft="10dp"
android:text="RadioButton" />


android:button="@null":This statement hides the original system's RadioButton icon.
android:drawableRight="@android:drawable/btn_radio":Add a btn_radio icon that comes with the system to the right of the original icon. I think the RadioButton is packaged on the btn_radio icon.



IOS:Just extend Uibutton to custom button,and modify like this:



CGFloat imageWidth = jumpBtn.imageView.bounds.size.width;
CGFloat labelWidth = jumpBtn.titleLabel.bounds.size.width;
jumpBtn.imageEdgeInsets = UIEdgeInsetsMake(0, labelWidth, 0, -labelWidth);
jumpBtn.titleEdgeInsets = UIEdgeInsetsMake(0, -imageWidth, 0, imageWidth);


The titleEdgeInsets property and the imageEdgeInsets property are only used to adjust the image and label position properties when the button is drawn, and do not affect the size of the button itself.



If the image is to the right and the label is to the left, the left side of the image is shifted to the right of the labelWidth from the left side of the button, and the right side of the image is moved to the right by the labelWidth from the left side of the label.






share|improve this answer
























  • Thanks for the help, will try this one and let you know.

    – MShah
    Jan 3 at 13:34











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54003665%2fin-radio-button-control-how-to-achieve-text-before-radio-circle%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









1














from the shared link, the default style is Title right and Image left.And the project is based on Custom renderer to do that. You can find the renderer here.
enter image description here
so you can modify this style by renderer.In the shared project not custom RadioButton
in Android and Button in IOS.Then you need custom in each of them.



Android :you can modify xml to exchange the title and image of RadioButton like this:



  <RadioButton
android:id="@+id/button1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:button="@null"//set null
android:checked="true"
android:drawableRight="@android:drawable/btn_radio"//reset the image
android:paddingLeft="10dp"
android:text="RadioButton" />


android:button="@null":This statement hides the original system's RadioButton icon.
android:drawableRight="@android:drawable/btn_radio":Add a btn_radio icon that comes with the system to the right of the original icon. I think the RadioButton is packaged on the btn_radio icon.



IOS:Just extend Uibutton to custom button,and modify like this:



CGFloat imageWidth = jumpBtn.imageView.bounds.size.width;
CGFloat labelWidth = jumpBtn.titleLabel.bounds.size.width;
jumpBtn.imageEdgeInsets = UIEdgeInsetsMake(0, labelWidth, 0, -labelWidth);
jumpBtn.titleEdgeInsets = UIEdgeInsetsMake(0, -imageWidth, 0, imageWidth);


The titleEdgeInsets property and the imageEdgeInsets property are only used to adjust the image and label position properties when the button is drawn, and do not affect the size of the button itself.



If the image is to the right and the label is to the left, the left side of the image is shifted to the right of the labelWidth from the left side of the button, and the right side of the image is moved to the right by the labelWidth from the left side of the label.






share|improve this answer
























  • Thanks for the help, will try this one and let you know.

    – MShah
    Jan 3 at 13:34
















1














from the shared link, the default style is Title right and Image left.And the project is based on Custom renderer to do that. You can find the renderer here.
enter image description here
so you can modify this style by renderer.In the shared project not custom RadioButton
in Android and Button in IOS.Then you need custom in each of them.



Android :you can modify xml to exchange the title and image of RadioButton like this:



  <RadioButton
android:id="@+id/button1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:button="@null"//set null
android:checked="true"
android:drawableRight="@android:drawable/btn_radio"//reset the image
android:paddingLeft="10dp"
android:text="RadioButton" />


android:button="@null":This statement hides the original system's RadioButton icon.
android:drawableRight="@android:drawable/btn_radio":Add a btn_radio icon that comes with the system to the right of the original icon. I think the RadioButton is packaged on the btn_radio icon.



IOS:Just extend Uibutton to custom button,and modify like this:



CGFloat imageWidth = jumpBtn.imageView.bounds.size.width;
CGFloat labelWidth = jumpBtn.titleLabel.bounds.size.width;
jumpBtn.imageEdgeInsets = UIEdgeInsetsMake(0, labelWidth, 0, -labelWidth);
jumpBtn.titleEdgeInsets = UIEdgeInsetsMake(0, -imageWidth, 0, imageWidth);


The titleEdgeInsets property and the imageEdgeInsets property are only used to adjust the image and label position properties when the button is drawn, and do not affect the size of the button itself.



If the image is to the right and the label is to the left, the left side of the image is shifted to the right of the labelWidth from the left side of the button, and the right side of the image is moved to the right by the labelWidth from the left side of the label.






share|improve this answer
























  • Thanks for the help, will try this one and let you know.

    – MShah
    Jan 3 at 13:34














1












1








1







from the shared link, the default style is Title right and Image left.And the project is based on Custom renderer to do that. You can find the renderer here.
enter image description here
so you can modify this style by renderer.In the shared project not custom RadioButton
in Android and Button in IOS.Then you need custom in each of them.



Android :you can modify xml to exchange the title and image of RadioButton like this:



  <RadioButton
android:id="@+id/button1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:button="@null"//set null
android:checked="true"
android:drawableRight="@android:drawable/btn_radio"//reset the image
android:paddingLeft="10dp"
android:text="RadioButton" />


android:button="@null":This statement hides the original system's RadioButton icon.
android:drawableRight="@android:drawable/btn_radio":Add a btn_radio icon that comes with the system to the right of the original icon. I think the RadioButton is packaged on the btn_radio icon.



IOS:Just extend Uibutton to custom button,and modify like this:



CGFloat imageWidth = jumpBtn.imageView.bounds.size.width;
CGFloat labelWidth = jumpBtn.titleLabel.bounds.size.width;
jumpBtn.imageEdgeInsets = UIEdgeInsetsMake(0, labelWidth, 0, -labelWidth);
jumpBtn.titleEdgeInsets = UIEdgeInsetsMake(0, -imageWidth, 0, imageWidth);


The titleEdgeInsets property and the imageEdgeInsets property are only used to adjust the image and label position properties when the button is drawn, and do not affect the size of the button itself.



If the image is to the right and the label is to the left, the left side of the image is shifted to the right of the labelWidth from the left side of the button, and the right side of the image is moved to the right by the labelWidth from the left side of the label.






share|improve this answer













from the shared link, the default style is Title right and Image left.And the project is based on Custom renderer to do that. You can find the renderer here.
enter image description here
so you can modify this style by renderer.In the shared project not custom RadioButton
in Android and Button in IOS.Then you need custom in each of them.



Android :you can modify xml to exchange the title and image of RadioButton like this:



  <RadioButton
android:id="@+id/button1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:button="@null"//set null
android:checked="true"
android:drawableRight="@android:drawable/btn_radio"//reset the image
android:paddingLeft="10dp"
android:text="RadioButton" />


android:button="@null":This statement hides the original system's RadioButton icon.
android:drawableRight="@android:drawable/btn_radio":Add a btn_radio icon that comes with the system to the right of the original icon. I think the RadioButton is packaged on the btn_radio icon.



IOS:Just extend Uibutton to custom button,and modify like this:



CGFloat imageWidth = jumpBtn.imageView.bounds.size.width;
CGFloat labelWidth = jumpBtn.titleLabel.bounds.size.width;
jumpBtn.imageEdgeInsets = UIEdgeInsetsMake(0, labelWidth, 0, -labelWidth);
jumpBtn.titleEdgeInsets = UIEdgeInsetsMake(0, -imageWidth, 0, imageWidth);


The titleEdgeInsets property and the imageEdgeInsets property are only used to adjust the image and label position properties when the button is drawn, and do not affect the size of the button itself.



If the image is to the right and the label is to the left, the left side of the image is shifted to the right of the labelWidth from the left side of the button, and the right side of the image is moved to the right by the labelWidth from the left side of the label.







share|improve this answer












share|improve this answer



share|improve this answer










answered Jan 3 at 6:47









Junior Jiang - MSFTJunior Jiang - MSFT

848127




848127













  • Thanks for the help, will try this one and let you know.

    – MShah
    Jan 3 at 13:34



















  • Thanks for the help, will try this one and let you know.

    – MShah
    Jan 3 at 13:34

















Thanks for the help, will try this one and let you know.

– MShah
Jan 3 at 13:34





Thanks for the help, will try this one and let you know.

– MShah
Jan 3 at 13:34




















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54003665%2fin-radio-button-control-how-to-achieve-text-before-radio-circle%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

MongoDB - Not Authorized To Execute Command

How to fix TextFormField cause rebuild widget in Flutter

in spring boot 2.1 many test slices are not allowed anymore due to multiple @BootstrapWith