- Home
- Forum
- Xamarin.Forms
- Align checkbox on top if the text wrap on another line
Align checkbox on top if the text wrap on another line
Is it possible to align the checkbox to the top of the text if the the text wrap on many lines ?
This is the settings that I apply on my
SfCheckBox sfCheckBox = new SfCheckBox();
sfCheckBox.StateChanged += this.SfCheckBoxOnStateChanged;
examResult.QuestionResults.Add(new QuestionResult{ ChoiceId = r.Id, Response = false });
sfCheckBox.Text = string.Format($"{r.ResponseChoice}");
sfCheckBox.BindingContext = r;
sfCheckBox.CornerRadius = 3.0;
sfCheckBox.LineBreakMode = LineBreakMode.WordWrap;
sfCheckBox.Padding = new Thickness(0, 0, 0, 20);
questionPage.Children.Add(sfCheckBox);
Here the result :
Thank you,
SIGN IN To post a reply.
5 Replies
DD
Devakumar Dhanapoosanam
Syncfusion Team
March 4, 2020 03:23 AM UTC
Hi Sebastien,
Greetings from Syncfusion.
We have analyzed your requirement and would like to let you know that there is no direct support to achieve your requirement using the SfCheckbox.
Please let us know if you need any further assistance.
Regards,
Devakumar D
SB
Suranyi Balazs
October 14, 2021 06:52 AM UTC
Hi
Has any progress been made on the request?
Thank you
DD
Devakumar Dhanapoosanam
Syncfusion Team
October 15, 2021 05:13 PM UTC
Hi Suranyi,
As we said earlier there is no direct support to achieve your requirement using the SfCheckBox.
However we have achieved your requirement using a workaround adding the SfCheckBox inside Stacklayout. Please refer the below code example.
|
<StackLayout Orientation="Horizontal">
<buttons:SfCheckBox x:Name="checkBox" IsChecked="False" VerticalOptions="Start"/>
<Label Text="I agree to the terms of services for this site I agree to the terms of services for …"
LineBreakMode="WordWrap" TextColor="Black">
<Label.GestureRecognizers>
<TapGestureRecognizer NumberOfTapsRequired="1"
Tapped="TapGestureRecognizer_Tapped"/>
</Label.GestureRecognizers>
</Label>
</StackLayout> |
|
private void TapGestureRecognizer_Tapped(object sender, EventArgs e)
{
if (checkBox.IsChecked != null)
{
checkBox.IsChecked = !checkBox.IsChecked;
}
} |
Output:
Please let us know if you need any further assistance on this.
Regards,
Devakumar D
SB
Suranyi Balazs
October 25, 2021 10:48 AM UTC
Hi,
Thank you :)
Regards,
Balázs
PR
Preethi Raju
Syncfusion Team
October 26, 2021 08:49 AM UTC
Hi Balázs,
You are welcome. Please let us know if you require any further assistance.
Regards,
Preethi.
SIGN IN To post a reply.
- 5 Replies
- 4 Participants
-
SÉ Sébastien
- Mar 2, 2020 09:14 PM UTC
- Oct 26, 2021 08:49 AM UTC