I am working on a xamarin forms application which is a cross-platform where it should work in android, ios and uwp. We have a datepicker in our project. Once we open the date picker and select the date it should display it in the datepicker box.
Code:
<DatePicker x:Name="DatePickerControl" Format="dd/MM/yyyy" Date="{Binding FromDate}" Style="{StaticResource Body2/Black}"
IsVisible="{Binding FromDate, Converter={StaticResource DateTimeNullOrEmptyBoolConverter}}"
behaviours:CommonEntryBehaviour.ApplyTransparentBGEffect="True">
<DatePicker.Behaviors>
<behaviours:EventToCommandBehavior
EventName="DateSelected"/>
</DatePicker.Behaviors>
</DatePicker>
Now the issue is in android and uwp it is working fine. But in ios while selecting the date in the date picker it is showing the date in the text box with the first two characters cutting. Can anyone tell me how to resolve this issue.
Related
I have a Xamarin Forms Shell app where I have implemented the Shell SearchHandler. The cancel button shows a book image.
This only occurs on iOS - on Android, there is no cancel button.
My xaml looks like this:
<Shell.SearchHandler>
<controls:RouteSearchHandler
x:Name="RouteSearch"
BackgroundColor="White"
ClearPlaceholderCommand="{Binding ClearSearch}"
ClearPlaceholderIcon="{StaticResource Cancel}"
DisplayMemberName="Street1"
SearchBoxVisibility="{Binding TopSearchVisibility, Converter={StaticResource visibleConvert}}"
ShowsResults="True" />
</Shell.SearchHandler>
How do I change the cancel icon from a book to another fonticon or image?
It seems a potential issue , the team set a default(book) icon on Clear button.
Workaround
You can prepare a small/transparent image and place it in Resources folder in iOS project , and set ClearPlaceholderIcon with it, then the problem should be solved .
And Feel free to file the feature request on github :https://github.com/xamarin/Xamarin.Forms/issues.
I have a weird issue with my UWP version of the xamarin forms project. The clicking is not working as expected. Sometimes no response when clicking items (button, image), and sometimes top items are opening when clicking an item.
Please watch this video for getting a clear idea. In this video, I am clicking the next button(Quiz page) several times, but no response. On the game page, the top item pages are opening when clicking an item. In android and ios, everything is working fine.
Version Details:
Xamarin Forms: 4.7.0.968
UWP target version: Windows 10, version 1903(10.0;Build 18362)
UWP Min version: Windows 10, Fall Creators Update(10.0; Build 16299)
Please help me to find the issue behind this. Thanks in advance.
Update
Button Code
<Button
Text="NEXT"
TextColor="White"
HorizontalOptions="EndAndExpand"
BackgroundColor="#f5c74c"
Clicked="NextButtonClicked"
WidthRequest="150"
HeightRequest="40"
FontSize="18"
BorderRadius="20"/>
public void NextButtonClicked(object sender, EventArgs args)
{
//action
}
I have solved this issue by updating the xamarin forms version to 4.8.0.1269.
is it possible to create a page that looks like a calendar ( Pretty much like the basic calendar app on your phone) with xamarin.forms ?
I've been searching and all i see is some prenium widget from companies.
I'm new to xamarin.forms and im unsure if this will be possible.
Thanks.
xmlns:controls="clr-namespace:XamForms.Controls;assembly=XamForms.Controls.Calendar"
<StackLayout>
<controls:Calendar Padding="10,0,10,0"
SelectedBorderWidth="4"
DisabledBorderColor="Black"
ShowNumberOfWeek="false"
StartDay="Monday"
TitleLabelTextColor="Purple"
TitleLeftArrowTextColor="Blue"
SelectedDate="{Binding Date}"
SpecialDates="{Binding Attendances}"
DateCommand="{Binding DateChosen}"/>
</StackLayout>
This is just as the title suggests. I've updated my Xamarin Forms project to a 1.6 NetStandard project and now the tapped event on my SfListView isn't working (It just doesn't fire at all).
Does anyone has any suggestions of what could be wrong or have faced anything like this?
EDIT
this is xaml code for SfListView:
<StackLayout HeightRequest="15" Grid.Row="0" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">
<xForms:SfListView Orientation="Horizontal" ItemSize="128" ItemsSource="{Binding Categories}" SelectionBackgroundColor="Transparent" IsScrollBarVisible="False">
<xForms:SfListView.ItemTemplate>
<DataTemplate>
<cells:CategoryCell />
</DataTemplate>
</xForms:SfListView.ItemTemplate>
<xForms:SfListView.Behaviors>
<behaviors:SfSelectedItemBehavior Command="{Binding FilterCommand}" />
</xForms:SfListView.Behaviors>
</xForms:SfListView>
</StackLayout>
this structure was working before the update. I use a behavior for item selection.
We have checked with the reported query “SfListView ItemTapped event does not trigger after updating the NetStandard Library” from our side. Unfortunately the reported issue does not occur at our end and the ItemTapped event is fired as expected.
For your reference, we have attached the working sample link below.
Sample link: http://www.syncfusion.com/downloads/support/directtrac/190562/ze/SfListViewSample-670965361
Can you please check in your device whether the issue reproduces in our sample also?
If so, Can you please share the below details?
Whether the reported issue occurs in particular device or all devices? (Can you please share the details of your tested device)
Whether the issue is produced in particular platform?
Whether the issue is produced in particular version of Xamarin.Forms and SfListView? (In our sample, we used XForms (v2.3.4.280) and SfListView(v15.3.0.33))
Also can you please share the share the template in which the SfListView items are loaded?
I'm getting an issue I don't understand. I have a Button with an image defined with the following code :
<Button Image="SearchFilterIcon.png"
Grid.Row="0"
Grid.Column="1"
Clicked="OnButtonFilterClicked" />
This works well on Android. The image is displayed on my button but when I launch the Windows Phone application, I get a XamlParseException which says that : No Property of name Image found.
How is it possible? The Button widget isn't the same on Android and Windows Phone?
If you do the following:-
Button objButton1 = new Button();
objButton1.Image = (FileImageSource)ImageSource.FromFile("testImage1.png");
objStackLayout.Children.Add(objButton1);
this.Content = objStackLayout;
Then it will work (via code-behind).
The Button control always had the Image property, even in Xamarin.Forms v1.2.2x, so this is not a new property introduced and nothing to do with having the latest packages installed.
As a workaround perhaps you should consider giving the XAML Button a x:Name as in:-
<Button x:Name="myButton1"/>
And then assign the image from code-behind:-
myButton1.Image = (FileImageSource)ImageSource.FromFile("testImage1.png");
Update 1
This was a case of very old libraries being used (v1.0.6186). Once the project is reupdated to the latest binaries for v1.2.3x, then this works fine.
The Button.Image is available on WP, just as it is on iOS and Android. You probably don't have the latest nuget (1.2.3) installed for WP, or you have multiple versions installed.
The buttons in XAML for Windows Phone simply do not provide an Image property. Thus, you cannot add an image to the button as the API doesn't support this. What you have to do is to create a control template that contains the text and the image.
Button documentation
Try some like:
<Button Click="OnButtonFilterClicked">
<Button.Background>
<ImageBrush Stretch="Fill" ImageSource="/SearchFilterIcon.png"/>
</Button.Background>
</Button>
instead of "Clicked" and "image" properties.