Telerik Forums
UI for Xamarin Forum
1 answer
89 views

Hello,

I am encountering an issue with the RadBorder control in Xamarin.Forms on iOS devices. The RadBorder control is not rendering correctly, and its properties such as Margin and CornerRadius are not being applied on iOS. I have tested the code on Android devices, where it functions as expected.

Here is a snippet of the XAML code that demonstrates the issue:

                            <telerikDataControls:RadListView x:Name="TaskList" 
                                                             Grid.Row="1"
                                                             IsItemSwipeEnabled="True"
                                                             ItemSwipeCompleted="TaskList_ItemSwipeCompleted"
                                                             SelectionChanged="TaskList_SelectionChanged"                                                   
                                                             SelectionMode="Single" 
                                                             SelectionGesture="Tap"            
                                                             SwipeOffset="50, 0, 50, 0" 
                                                             SwipeThreshold="10"
                                                             HeightRequest="30"
                                                             RefreshRequested="TaskList_RefreshRequested"
                                                             IsPullToRefreshActive="True"
                                                             IsPullToRefreshEnabled="True"
                                                             VerticalOptions="FillAndExpand"
                                                             BackgroundColor="LightGray" >
                                <telerikDataControls:RadListView.ItemTemplate >
                                    <DataTemplate>
                                        <telerikListView:ListViewTemplateCell >
                                            <telerikListView:ListViewTemplateCell.View>
                                                <Grid >
                                                    <telerikPrimitives:RadBorder BorderColor="#268ecd" Margin="3,6" BorderThickness="0" CornerRadius="18" >
                                                        <StackLayout Orientation="Horizontal" 
                                                                 Style="{StaticResource ListItem}" 
                                                                 VerticalOptions="FillAndExpand" 
                                                                 Padding="0" 
                                                                 BackgroundColor="White">
                                                            <BoxView BackgroundColor="{Binding CriticalityColors}" WidthRequest="7" HeightRequest="10" HorizontalOptions="Start"/>
                                                            <StackLayout Orientation="Vertical" HorizontalOptions="FillAndExpand" Spacing="0" Padding="0, 15">
                                                                <StackLayout Orientation="Vertical" HorizontalOptions="StartAndExpand" Spacing="5">
                                                                    <Label Text="{Binding TaskLabel}" Style="{StaticResource ListHeader}" TextColor="{StaticResource LightBlueColor}" />
                                                                    <Label Text="{Binding TargetLabel}" Style="{StaticResource ListInfo}" TextColor="{StaticResource GreyColor}" />
                                                                </StackLayout>
                                                                <StackLayout Orientation="Horizontal" HorizontalOptions="FillAndExpand" Spacing="5">
                                                                    <Label Text="{Binding CategoryDesc}" Style="{StaticResource ListInfo}" IsVisible="True" TextColor="{StaticResource GreyColor}" Padding="0, 5" HorizontalOptions="StartAndExpand"/>
                                                                    <Label x:Name="DesComplLbl" Text="{Binding DesComplDateParenthesis}" Style="{StaticResource ListInfo}" IsVisible="False" BindingContextChanged="DesComplLbl_BindingContextChanged" HorizontalOptions="End"  Padding="0, 5"/>
                                                                </StackLayout>
                                                            </StackLayout>
                                                            <Image x:Name="statusImg" HorizontalOptions="End" Source="{Binding StatusImage}" Margin="0,0,0,10"/>
                                                        </StackLayout>
                                                    </telerikPrimitives:RadBorder>
                                                </Grid>
                                            </telerikListView:ListViewTemplateCell.View>
                                        </telerikListView:ListViewTemplateCell>
                                    </DataTemplate>
                                </telerikDataControls:RadListView.ItemTemplate>
                                <telerikDataControls:RadListView.ItemSwipeContentTemplate>

I have also provided below the Expected Output (Android) and the Incorrect Output (iOS)

Also there is an other issue for the IOS that when i Load the List for the first time the spacing behaves irregularly but after i refresh it the spacing returns to normal 

I would appreciate any guidance or assistance in resolving this problem. Please let me know if you need any additional information or code samples.

Thank you for your support.
0 answers
120 views

Hi,

List view is not rendering on the iphone/Simulator with iOS 16

When i try to load it on ipad with ios14, it was working fine.

I see below errors in output when debugging in VS2022

*** Assertion failure in -[TKCollectionView _Bug_Detected_In_Client_Of_UICollectionView_Invalid_Batch_Updates:], UICollectionView.m:10064
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid batch updates detected: the number of sections and/or items returned by the data source before and/or after performing the batch updates are inconsistent with the updates.

Please advise if this is known issue.

Xamarin Control Version - 2021.1.413.0

iOS SDK - 16.4/15.5

Thank you

Balwinder

Elvin
Top achievements
Rank 1
 asked on 06 Jun 2023
0 answers
101 views

Hi, I have an issue with RadListView Pull To Refresh, it doesn't work for iOS after using MyControl. MyControl opens RadPopup.

Down below-written sommelier code, please help to fix the issue.

<Grid VerticalOptions="FillAndExpand" HorizontalOptions ="FillAndExpand" RowSpacing="0" BackgroundColor="Red">
      <Grid.RowDefinitions>
        <RowDefinition Height="{x:Static resource:UiConst.ViewSize45}"/>
        <RowDefinition Height="{x:Static resource:UiConst.ViewSize1}"/>
        <RowDefinition Height="*"/>
      </Grid.RowDefinitions>
      <StackLayout Grid.Row="0" Margin="10, 3, 0, 0" >
              //do something 
      </StackLayout>

      <BoxView Grid.Row="1"  />

 
        <datacontrols:RadListView     x:Name="listview"   BackgroundColor="Azure" Margin="0, 0, 0, 1"
                                    Grid.Row="2" HorizontalOptions = "FillAndExpand" VerticalOptions = "StartAndExpand"
                                    IsItemSwipeEnabled="True" 
                                    ItemSwipeCompleted="OnItemSwipeCompleted"
                                    ItemSwipeStarting ="Listview_ItemSwipeStarting"
                                    ItemsSource="Item"
                                    SelectionMode="None" 
                                    ItemTapped="ItemTapped"
                                    SwipeOffset="75,0,0,0" SwipeThreshold="10" 
                                    RefreshRequested="RadListView_RefreshRequested" 
                                    IsPullToRefreshEnabled="True" IsPullToRefreshActive="false">
          <datacontrols:RadListView.ItemTemplate>
            <DataTemplate>
              <listview:ListViewTemplateCell>
                <listview:ListViewTemplateCell.View>
                  <Grid HorizontalOptions="FillAndExpand" VerticalOptions="Center" Margin="0, 0, 0, -5">
                    <Grid.BackgroundColor>
                      <Binding Path="ReadTimeStamp" Mode="TwoWay">
                        <Binding.Converter>
                          <conv:NullToObjectConverter x:TypeArguments="Color"
                                               NullObject="blue"
                                               NotNullObject="white"/>
                        </Binding.Converter>
                      </Binding>
                    </Grid.BackgroundColor>

                    <Grid.RowDefinitions>
                      <RowDefinition Height="70"/>
                      <RowDefinition Height="1"/>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                      <ColumnDefinition Width="80"/>
                      <ColumnDefinition Width="*"/>
                      <ColumnDefinition Width="80"/>
                    </Grid.ColumnDefinitions>

                    <Frame Grid.Column="0" Grid.Row="0" Margin="10, 5, 10, 0" >

                                <StackLayout>

                        <svg:SvgCachedImage />

                        <Label Text="text"/>
                      </StackLayout>
                    </Frame>

                   
                    <StackLayout Grid.Column="1" Grid.Row="0" Margin="5, 10, 5,  0" >
                      <Label Text=""/>

                      <Label Text=""/>
                    </StackLayout> 

                    <StackLayout Grid.Column="2" Grid.Row="0" Margin="0, 10, 5, 0"  >
                      <Grid   >
                        <Frame >
                                 <svg:SvgCachedImage /> 
                        </Frame>

                        <controls:MyControl"/>
                      </Grid>
                     
                      <Label Text=""/> 
                    </StackLayout>

                    <BoxView Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="3"/>
                  </Grid>
                </listview:ListViewTemplateCell.View>
              </listview:ListViewTemplateCell>
            </DataTemplate>
          </datacontrols:RadListView.ItemTemplate>
          <datacontrols:RadListView.ItemSwipeContentTemplate>
            <DataTemplate>
              <Grid Margin="0"
                  Padding="0"
                  ColumnSpacing="0"
                  RowSpacing="0" 
                  BackgroundColor="">
                <Grid.ColumnDefinitions>
                  <ColumnDefinition Width="75"/>
                  <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <StackLayout >
                  <svg:SvgCachedImage 
                     WidthRequest="30" HeightRequest="30"
                     Source="{Binding SwipeIconSource}"/>
                  <Label   Text="">
                </StackLayout>
              </Grid>
            </DataTemplate>
          </datacontrols:RadListView.ItemSwipeContentTemplate>
        </datacontrols:RadListView>
      </Grid>
    </Grid>

                                   
Hakob
Top achievements
Rank 1
 updated question on 07 Apr 2023
0 answers
67 views

Hi,

I have a Xamarin Forms application using RadListView. As part of the ItemTemplate I have a Switch as described below:

<Switch
                HorizontalOptions="Start"
                IsEnabled="True"
                IsToggled="{Binding Toggle}"
                IsVisible="{Binding IsConfirmCheckVisible}"
                OnColor="Green"
                ThumbColor="Green">
                <Switch.Triggers>
                    <DataTrigger
                        Binding="{Binding Source={x:Reference chkConfirmCheck}, Path=IsToggled}"
                        TargetType="Switch"
                        Value="False">
                        <Setter Property="ThumbColor" Value="Red" />
                        <Setter Property="OnColor" Value="Red" />
                        <Setter Property="IsEnabled" Value="False" />
                    </DataTrigger>
                </Switch.Triggers>
                <Switch.Behaviors>
                    <behaviors:EventToCommandBehavior
                        Command="{Binding Source={x:Reference ParentBindingContext}, Path=BindingContext.UpdateTrickCommand}"
                        CommandParameter="{Binding .}"
                        EventName="Toggled" />
                </Switch.Behaviors>
            </Switch>

If I have a list of items in the RadListView and I start to scroll, then the Toggled event is fired on the Switch. All items for the RadListView is an ObservableCollection and it is loaded when the screen is opened. Is there an issue with the code above that would cause the Toggled event to be fired upon scrolling in a RadListView? This issue only appears on iOS and on a Phone. The iPad and Android devices behave as it's supposed to i.e. Just scrolls as normal and does not fire the Toggle event.

 Telerik UI For Xamarin Version: 2022.1.117.1
Nivesh
Top achievements
Rank 1
 updated question on 20 Sep 2022
0 answers
99 views

Hello,

I have an issue regarding the Load on Demand behavior of the Telerik ListView for Xamarin. First i will explain how i defined my ListView and how it should work. The ListView was defined as follows:

            <telerikDataControls:RadListView
                ItemsSource="{Binding MyTickets}"
                SelectedItem="{Binding SelectedTicket, Mode=TwoWay}"
                SelectionMode="Single"
                HeaderTemplate="{StaticResource HeaderTemplate}" 
                FooterTemplate="{StaticResource FooterTemplate}"
                Grid.Row="3"
                IsLoadOnDemandEnabled="True"
                LoadOnDemandMode="Automatic">
                <telerikDataControls:RadListView.Behaviors>
                    <prism:EventToCommandBehavior
                        Command="{Binding ItemTappedCommand}"
                        EventName="ItemTapped" />
                    </telerikDataControls:RadListView.Behaviors>
                <telerikDataControls:RadListView.Commands>
                    <telerikListViewCommands:ListViewUserCommand 
                        Id="LoadOnDemand"                         
                        Command="{Binding LoadItemsCommand}" />
                </telerikDataControls:RadListView.Commands>
                <telerikDataControls:RadListView.ItemTemplate>
                                        ...
                 </telerikDataControls:RadListView.ItemTemplate>
             </telerikDataControls:RadListView>

I have left out the ItemTemplate since it is not relevant for the problem.

As you can see we use the LoadOnDemandMode Automatic for this ListView to load the Data. When the LoadOnDemand event is triggered we load the data with the LoadItemsCommand. The LoadItemsCommand loads 10 elements at a time which functions as lazy loading. The Telerik ListView default value for the MaxRemainingItems is 10. The problem now is that the LoadItemsCommand is triggered twice when opening the page since only 10 elements are loaded each time. We would like to only load 10 elements each time and if the user scrolls down we want to load the next 10 elements.

To solve this problem we tried creating a custom renderer for the ListView and change the value of MaxRemainingItems. We were able to change the value of MaxRemainingItems in the custom renderer but after doing so our LoadItemsCommand was never triggered when the user was scrolling through the ListView. The custom renderer and Listview were tested for Android. I hope you can help us resolve this issue.

We are using Telerik.UI.for.Xamarin Nuget-Package Version 2022.1.1.

Thank you in advance.

 

 

 

 

Marco
Top achievements
Rank 1
 asked on 02 May 2022
0 answers
547 views

We developed a mobile app using Telerik Xamarin components in 2017.

It is all working fine till Apple released IOS 15. Now when we try to open the list view the app just shuts down. The app still works fine till 14.7 version

Any of you had a similar issue or support has a clue. Pls let us know.

Krishna
Top achievements
Rank 1
 asked on 01 Dec 2021
0 answers
194 views

Hello,

I'm trying to evaluate the TagIt example. I have it working in a debug environment. It runs on all the simulators (Android and iOS). It runs in UWP as well.

However, when I run it on my iPhone it crashes consistently in the PickerPage view when I display my images. I have hundreds of images in my phone, but the code is only trying to show the first 100.

After the first page of images appears, I swipe up to show the next page, and the application exits. It looks like a crash.

I put unhandled exception handlers in the iOS application (according to this reference - global-error-handling-xamarin-forms). They are not hit, nor do they record any useful exception information. The output log shows no exceptions.

Output Log:

Resolved pending breakpoint at 'AppDelegate.cs:77,1' to void tagit.iOS.AppDelegate.LogUnhandledException (System.Exception exception) [0x00002].
Resolved pending breakpoint at 'AppDelegate.cs:101,1' to void tagit.iOS.AppDelegate.DisplayCrashReport () [0x00007].
Thread started: <Thread Pool> #3
Thread started: <Thread Pool> #4
Thread started: <Thread Pool> #5
Thread started: <Thread Pool> #6
2021-10-06 05:40:45.206 tagit.iOS[13433:3334804] WARNING: This app's CFBundleDevelopmentRegion is not a string value. This can lead to unexpected results at runtime. Please change CFBundleDevelopmentRegion in your Info.plist to a string value.

Thread started: <Thread Pool> #7
Thread started: <Thread Pool> #8
Thread started: <Thread Pool> #9
Thread started: <Thread Pool> #10
Thread started:  #11
Thread started: <Thread Pool> #12
Thread started: <Thread Pool> #13
Thread started: <Thread Pool> #14
Thread started: <Thread Pool> #15
2021-10-06 05:40:56.010 tagit.iOS[13433:3334909] A task was canceled.
System.Threading.Tasks.TaskCanceledException: A task was canceled.
  at FFImageLoading.Work.ImageLoaderTask`3[TDecoderContainer,TImageContainer,TImageView].Init () [0x00164] in <a159011f32534c8eb0455a9cf0bad5a7>:0

2021-10-06 05:40:56.012 tagit.iOS[13433:3335672] A task was canceled.
System.Threading.Tasks.TaskCanceledException: A task was canceled.
  at FFImageLoading.Work.ImageLoaderTask`3[TDecoderContainer,TImageContainer,TImageView].Init () [0x00164] in <a159011f32534c8eb0455a9cf0bad5a7>:0

2021-10-06 05:40:56.017 tagit.iOS[13433:3334837] A task was canceled.
System.Threading.Tasks.TaskCanceledException: A task was canceled.
  at FFImageLoading.Work.ImageLoaderTask`3[TDecoderContainer,TImageContainer,TImageView].Init () [0x00164] in <a159011f32534c8eb0455a9cf0bad5a7>:0

2021-10-06 05:40:56.019 tagit.iOS[13433:3334910] A task was canceled.
System.Threading.Tasks.TaskCanceledException: A task was canceled.
  at FFImageLoading.Work.ImageLoaderTask`3[TDecoderContainer,TImageContainer,TImageView].Init () [0x00164] in <a159011f32534c8eb0455a9cf0bad5a7>:0

2021-10-06 05:40:56.030 tagit.iOS[13433:3334910] A task was canceled.
System.Threading.Tasks.TaskCanceledException: A task was canceled.
  at FFImageLoading.Work.ImageLoaderTask`3[TDecoderContainer,TImageContainer,TImageView].Init () [0x00164] in <a159011f32534c8eb0455a9cf0bad5a7>:0

Thread started: <Thread Pool> #16
Thread started: <Thread Pool> #17
The app has been terminated.

Development Environment:

  • VS 2019 v 16.11.4
  • Telerik UI for Xamarin R2 2021
  • XCode 13
  • Xamarin Forms 5.0.0.2083

I installed the TagIt app from the App Store. It does the same thing.

Any help would be appreciated.

Robert
Top achievements
Rank 1
 asked on 06 Oct 2021
1 answer
99 views

Hello,

I'm trying to implement list of medications grouped by first letter, like in attached example.

For this I'm using Radlistview with Sticky header, and so far everything looks good.

In addition we have a-z view on right side which should be updated on scroll.

Can we somehow detect which group is curently sticked, that we can update this view?

Or there is some other control that can provide us a-z view on side?

 

Best,

Jovana

Didi
Telerik team
 answered on 27 Jul 2021
1 answer
662 views

Hi,

Is it possible to have a transparent background on IOS?

I tried setting BackgroundColor="Transparent" and it works fine on Android but not on IOS.

Please help.

 

Lance | Manager Technical Support
Telerik team
 answered on 13 Nov 2019
4 answers
174 views

I am having following error while using native iOS phones (but it is not happening on iPhone Simulator)

-[TKDataSource itemAtIndex:forSection:]
NSRangeException: *** -[__NSArrayM objectAtIndexedSubscript:]: index 12 beyond bounds [0 .. 0]

 

Below is the XAML I am using:

<telerikDataControls:RadListView Grid.Row="2" VerticalOptions="StartAndExpand" LoadOnDemandMode="Manual"
                    ItemsSource="{Binding Records}"
                    SelectedItem="{Binding SelectedRecord}"
                    IsLoadOnDemandEnabled="true" IsPullToRefreshEnabled="false">
                    <telerikDataControls:RadListView.ItemTemplate>
                        <DataTemplate>
                             <telerikListView:ListViewTemplateCell>
                                <telerikListView:ListViewTemplateCell.View>
                                    <Grid>
                                        <StackLayout Spacing="2" Margin="20,5,5,5">
                                            <Label Text="{Binding Title}" FontSize="16" LineBreakMode="TailTruncation" FontAttributes="Bold"  />
                                            <Label Text="{Binding Subtitle}" LineBreakMode="TailTruncation" FontSize="14" TextColor="Gray"  />
                                        </StackLayout>
                                    </Grid>
                                </telerikListView:ListViewTemplateCell.View>
                            </telerikListView:ListViewTemplateCell>
                        </DataTemplate>
                    </telerikDataControls:RadListView.ItemTemplate>
                    <telerikDataControls:RadListView.LayoutDefinition>
                        <telerikListView:ListViewLinearLayout ItemLength="50" />
                    </telerikDataControls:RadListView.LayoutDefinition>
 </telerikDataControls:RadListView>

 

Below is the ViewModel.cs which sets Records:

private ObservableCollection<ViewRecordItem> _records=new ObservableCollection<ViewRecordItem>();
public ObservableCollection<ViewRecordItem> Records { get => _records; set { _records = value; OnPropertyChanged(); } }
private async Task Search(bool isNew = true) {
 
           try
           {
               IsBusy = true;
               CanRefresh = true;
 
               if (isNew) _page = 1; else _page++;
 
               ViewRecordItem[] recs = await svc.GetViewRecordItems(MyViewItem, page: _page, filter: GetFilters());
 
               if (isNew) Records.Clear();
               if (recs.Length == 0)
               {
                   throw new Exception("Search could find any record.");   
               }
 
               foreach (var rec in recs)
               {
                   Records.Add(rec);
               }
           }
           catch (Exception ex)
           {
               AlertService.Instance.ShowMsg(ex.Message);
               CanRefresh = false;
           }
           IsBusy = false;
       }

 

Below is the crash report from Mobile Center

CoreFoundation __exceptionPreprocess
libobjc.A.dylib objc_exception_throw
 
CoreFoundation _CFThrowFormattedException
CoreFoundation -[__NSArrayM objectAtIndexedSubscript:]
 
ExelareMobile.iOS -[TKDataSource itemAtIndex:forSection:]
ExelareMobile.iOS -[TKDataSource listView:cellForItemAtIndexPath:]
ExelareMobile.iOS -[TKListView collectionView:cellForItemAtIndexPath:]
 
UIKit-[UICollectionView _createPreparedCellForItemAtIndexPath:withLayoutAttributes:applyAttributes:isFocused:notify:]
UIKit-[UICollectionView _updateVisibleCellsNow:]
UIKit-[UICollectionView layoutSubviews]
UIKit-[UIView(CALayerDelegate) layoutSublayersOfLayer:]
Stefan Nenchev
Telerik team
 answered on 10 Nov 2017
Top users last month
Dominik
Top achievements
Rank 1
Giuliano
Top achievements
Rank 1
Dominic
Top achievements
Rank 1
Glendys
Top achievements
Rank 1
NoobMaster
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?