Forum Xamarin.Forms

Xamarin.Forms 2.2.0

24567

Posts

  • FredyWengerFredyWenger CHInsider ✭✭✭✭✭

    @DerekPapworth.4183
    Not sure, but I had a similar problem a longer time ago with WP 8.1.
    To set the backgroundcolor to a color was the solution...

  • Matthew.4307Matthew.4307 USMember ✭✭✭

    For a Pre-Release this is looking very promising - It's not often that I upgrade Xamarin.Forms and bugs have been fixed without new ones being introduced.

    One happy Xamarin user right here :smile: . Please keep it up!

  • TheRealJasonSmithTheRealJasonSmith USXamarin Team Xamurai

    @BjornB because it was my understanding the people running into this issue were already encountering this. Though on closer inspection it turns out the docs somehow have that setting dropped though it was in our original porting guide, hence why not everyone was getting this issue. Interesting. Either way the docs are going to be updated.

  • PawelTktiPawelTkti USMember
    edited April 2016

    I have problem. After installation the newest version (pre2) all properties defined in styles override my properties in the controls. For example:

    Style:

    <Style x:Key="MainButtonStyle" TargetType="custom:MyButton">
      <Setter Property="BackgroundColor" Value="Red"/>
      <Setter Property="TextColor" Value="White"/>
      <Setter Property="BorderRadius" Value="0"/>
      <Setter Property="BorderWidth" Value="0"/>
    </Style>
    

    Button:

     <custom:MyButton Text="Need help" Style="{StaticResource MainButtonStyle}"  BackgroundColor="Black"  />
    

    In app BackgroundColor is Red (as Style), and should be Black.

    Is it bug?
    Or it can be changed in the code?

  • TheRealJasonSmithTheRealJasonSmith USXamarin Team Xamurai

    Does it happen with every control or just some?

  • TheRealJasonSmithTheRealJasonSmith USXamarin Team Xamurai

    @P3PPP CarouselView doesn't use Cells

  • PawelTktiPawelTkti USMember
    edited April 2016

    @TheRealJasonSmith said:
    Does it happen with every control or just some?

    Entry - bad
    Label - bad
    StackLayout - good
    BoxView - good

    Button is strange...
    If I'm using Custom Renderer, all properties defined in styles override my properties. If I'm not using CR everything is ok.

    Button is black:

    <Button Text="Need help" Style="{StaticResource MainButtonStyle}"  BackgroundColor="Black"  />
    

    Button is not black (because in styles property is red):

    <custom:MyButton Text="Need help" Style="{StaticResource MainButtonStyle}"  BackgroundColor="Black"  />`
    
  • P3PPPP3PPP JPMember ✭✭

    @TheRealJasonSmith Thanks for answer.
    It workes fine if I use views instead of cells.

  • MichaelDimoudisMichaelDimoudis AUUniversity ✭✭

    I updated to 2.2.0-pre2 and I can't compile my android forms app because of over 100 errors in resources.designer.cs file. Is this just me and my solution or is there a workaround/fix or something I'm doing wrong? I have all the updated Android SDK's etc...

  • MiguelCervantesMiguelCervantes MXMember ✭✭✭

    @TheRealJasonSmith said:
    @P3PPP CarouselView doesn't use Cells

    @TheRealJasonSmith I have a ContentView on a CarouselView but no content is displayed, the ContentView has the standard Stacklyaout and a label.

  • ChaseFlorellChaseFlorell CAInsider, University mod

    @TheRealJasonSmith | @BryanHunterXam, am I reading this right?

    [Core] Automatically marshal all AnimationExtensions calls onto UI thread

    fixes

  • PaulDiPietroPaulDiPietro USXamarin Team Xamurai

    @MichaelDimoudis have you done a clean/rebuild and possibly restart XS/VS?

  • JeffDalbyJeffDalby USUniversity ✭✭
    edited April 2016

    Looks like 2.2 breaks Azure Mobile Services Authentication on Android which is a too bad cause outside of this it seems to be an awesome update for us. Calling MobileService.LoginAsync(Forms.Context,myidp) Brings up the authenticate screen but it is blank. Backreving to 2.1 fixes it.

  • TheRealJasonSmithTheRealJasonSmith USXamarin Team Xamurai

    @JeffDalby which backend are you using?

  • JeffDalbyJeffDalby USUniversity ✭✭
    edited April 2016

    Old mobile services, not the new stuff. Last I had looked a few months ago we couldn't migrate because we store user data based on the id from the provider which would change if we moved to app services. Probably should look if there is a fix for that yet.

    Regardless, it seems something has changed on the Forms end since all I have to do is update to break it. Maybe something with how it handles passing Forms.Context to display the login page from the IDP?

  • JKayJKay USMember ✭✭✭

    @MichaelDimoudis This is ususally down to a third party control not referencing the pre release Forms version. For me it was Syncfusion Datagrid. Have a closer look at the resources and you should be able to figure out what is causing those erros

  • MichaelRumplerMichaelRumpler ATMember ✭✭✭✭✭

    I finally managed to compile all dependencies with pre2 which made my problems with the Resources.designer.cs go away.

    But this doesn't fix the "IllegalStateException: Recursive entry to executePendingTransactions", it makes it much worse. Now I get that exception every time I try to navigate. I created bug 40333 for that.

  • MichaelRumplerMichaelRumpler ATMember ✭✭✭✭✭

    @AdamP I saw your blog post and found some things I didn't encounter yet. And I thought I got them all!

    But unfortunately when I delete the contents of the Resources.designer.cs file and recompile, my VS2015 does not regenerate the full file. It just creates an empty Resources class. Any idea how I can trigger that? The only thing which worked for reliably for me is installing a different XF version, but that takes very long.

  • SoerntPoppeSoerntPoppe DEUniversity ✭✭

    Can we pretty please get this Bug - 31809 fixed?

  • AdamPAdamP AUUniversity ✭✭✭✭✭
    edited April 2016

    @MichaelRumpler - I haven't seen that one in about a year. Have you tried deleting everything from Resources, then closing VS, deleting the bin and obj, then starting again and rebuilding? The obj cache sometimes causes intermittent issues.

    Then in your .proj file, this is just a check, that this exists (it probably will)
    <AndroidResgenFile>Resources\Resource.Designer.cs</AndroidResgenFile>

    Also I will suspect you have this further down but I have known Xamarin installs / reinstalls to mess around with these properties before

    <Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />

    Then in your MSBuild\Xamarin\Android\Xamarin.Android.CSharp.targets that should reference the Resources.Designer.cs file.

    In the Xamarin.Android.Common.targets I found this, but at this point I am wildly speculating that maybe the temporary file is failing to create, hence not being copied.

        <!-- Only copy if the file contents changed, so users only get Reload? dialog for real changes -->
        <CopyIfChanged
            SourceFiles="$(ResgenTemporaryDirectory)\$(AndroidResgenFilename)"
            DestinationFiles="$(_AndroidResourceDesignerFile)"
            Condition="'$(_AndroidResourceDesignerFile)' != '' And Exists ('$(ResgenTemporaryDirectory)\$(AndroidResgenFilename)')"
        />
    
        <!-- Delete our temporary directory -->
        <RemoveDirFixed Directories="$(ResgenTemporaryDirectory)" />
    
        <!-- If there are no _AndroidResource items, create a blank file -->
        <CreateAndroidResourceStamp
            Condition="'$(_AndroidResourceDesignerFile)' != ''"
            AndroidResgenFile="$(_AndroidResourceDesignerFile)"
            AndroidResourceDest="@(_AndroidResourceDest)"
            MonoAndroidResDirIntermediate="$(MonoAndroidResDirIntermediate)"
            AndroidResgenFlagFile="$(_AndroidResgenFlagFile)" />
    

    The temporary files from MSBuild should be created in AppData\Local\Temp. If they are lingering around that could be causing and issue, I would also try wiping this directory. It shouldn't ever use the same directory again for the temp file but I am grasping at straws here :)

    I just went through all that to check if the MSBuild config files are all in order, its the only thing I could think of that Xamarin would update and what could cause the Resources.Designer.cs not to re-generate again. Maybe with a process not releasing locks on temporary files as needed or something similar.

  • MichaelRumplerMichaelRumpler ATMember ✭✭✭✭✭

    Thanks, @AdamP , some more things I can check.

    I did delete the Resources' contents, deleted bin/obj and restarted VS, but I didn't check the rest as I didn't know, how generating that file is triggered/works.

    The error appears, when you change some dependencies like you already wrote, but also when I change .axml files in my Android project which I use in my custom renderers. Sometimes those changes will not be reflected in the Resources.designer.cs file.

  • LesterMeeksLesterMeeks USMember ✭✭

    https://bugzilla.xamarin.com/show_bug.cgi?id=40320 this has been a long standing issue for our implementation of our custom cell (no renderers, just a stack of labels and images). Seems to still be here for 2.2. Any thoughts @TheRealJasonSmith

  • DerekPapworth.4183DerekPapworth.4183 GBMember ✭✭
    edited April 2016

    @TheRealJasonSmith - Following on from my earlier post in here on issue with contextmenu not firing in ListView in Windows UWP I've done some more investigation and it appears the Cell in the ListView is not obeying the FillAndExpand or StartAndExpand in ListView and hence the contextmenu is only being triggered if tapped within the non-expanded cell limits. To check this I added background colour to my cell and as you can in attached captured pic when I tap (right click in this case as Windows UWP) on 4th cell for instance the highlight of the listview item covers complete width but cell doesn't. However same code exactly works fine in iOS, Android, Windows Phone 8.1 Silverlight but in the case of Windows UWP or Windows 8.1 I get this result. Apart from not being right, it means contextmenu won't work unless you tap inside the cell rather than just listitem which when no background colour used is difficult to tell. Any clues or is this a bug?

    p.s. Just to confirm as don't have screenshots to hand, in iOS, Android and Windows Phone with same aqua background set the colour covers complete width in all listitems with exactly same code.

  • Matthew.4307Matthew.4307 USMember ✭✭✭

    @DerekPapworth.4183 said:
    @TheRealJasonSmith - Following on from my earlier post in here on issue with contextmenu not firing in ListView in Windows UWP I've done some more investigation and it appears the Cell in the ListView is not obeying the FillAndExpand or StartAndExpand in ListView and hence the contextmenu is only being triggered if tapped within the non-expanded cell limits. To check this I added background colour to my cell and as you can in attached captured pic when I tap (right click in this case as Windows UWP) on 4th cell for instance the highlight of the listview item covers complete width but cell doesn't. However same code exactly works fine in iOS, Android, Windows Phone 8.1 Silverlight but in the case of Windows UWP or Windows 8.1 I get this result. Apart from not being right, it means contextmenu won't work unless you tap inside the cell rather than just listitem which when no background colour used is difficult to tell. Any clues or is this a bug?

    p.s. Just to confirm as don't have screenshots to hand, in iOS, Android and Windows Phone with same aqua background set the colour covers complete width in all listitems with exactly same code.

    There was a similar sort of issue in Windows RT where the content of a List View header template wouldn't expand even though it was set to, my workaround was WidthRequest = 5000. Though this is no longer an issue in 2.2pre 2.

    As a workaround you should be able to set a really wide WidthRequest and it'll just go as wide as the screen is.

  • AdamPAdamP AUUniversity ✭✭✭✭✭
    edited April 2016

    @MichaelRumpler - just to clarify, you change something in Android, it doesn't regenerate, you delete the file and it still doesn't generate?

    That one is tricky. Its almost like it thinks the file is generated already. I would probably try and get this in front of someone on the Android team in Xamarin, unless we can think of any idea on what is stopping that MSBuild process.

    While it should never reuse temporary folders again, I am thinking that when my deployment starts failing and I need to change something in my project, e.g. From Shared Runtime to not, to trigger it to deploy successfully again, it seems like something is getting locked. I might try deleting my temp folder when that happens to me again. It happens about every 5-10 build/deploys for me, so shouldn't be long. That might hint at a possible issue in Android's build process.

  • MiguelCervantesMiguelCervantes MXMember ✭✭✭
    edited April 2016

    Margin property is awesome!!

    Just one thing, on a ListView each element is a ViewCell with a grid inside but the margin is not respected on iOS, on android Works as spected. Pseudo code:

    *CustomViewCell code:

    var grid = new Grid()
            {
                Margin = 5,
                Padding = 0,
                RowSpacing = 0,
                ColumnSpacing = 0,
                RowDefinitions =
               {
            new RowDefinition { Height = new GridLength (20, GridUnitType.Absolute) },
               },
                ColumnDefinitions =
               {
                    new ColumnDefinition {Width = new GridLength(60, GridUnitType.Absolute)},
                    new ColumnDefinition {Width = new GridLength(60, GridUnitType.Auto)},
               }
            };
    View = grid;
    

    *ListView creation

            ListView Wall = new ListView(ListViewCachingStrategy.RecycleElement);
            Wall.RowHeight = 65;
            Wall.SeparatorVisibility = SeparatorVisibility.None;
    
            List<miniObject> Data = new List<miniObject>();
    
            for (int i = 0; i <= 30; i++ )
                Data.Add(new miniObject() { Text = "Element "+ i.ToString() });
    
    
            var cell = new DataTemplate(typeof(CustomViewCell));
            Wall.ItemTemplate = cell;
            Wall.ItemsSource = Data;
            Wall.HasUnevenRows = false;
    
  • DerekPapworth.4183DerekPapworth.4183 GBMember ✭✭

    @Matthew.4307 - Great tip Matthew, thanks! I've set a widthrequest in the cell to 5000 and works a treat. I don't like using workarounds so hope it gets fixed in next release but at least I can continue for now so thanks again!

  • ulinulin ESMember

    Hi, I'm testing the CarouselView. How can i hook up to the OnItemAppearing/Disappearing event? I see it exists on the assembly but there's no public accessor to it from the carouselview c# class/object.

    Thanks

  • fortinguillaumefortinguillaume FRBeta ✭✭

    Application crash on version 2.2.0.5-pre2 when you resume then back to android application who use Xamarin.Forms.
    Reproduce with Xamarin.Forms sample application (WorkingWithBehaviors application sample).

    Error :
    System.MissingMethodException: Method 'Looper.get_IsCurrentThread' not found.

    Stack trace:
    `System.AggregateException: One or more errors occurred.

    Thread finished: #5
    04-14 21:05:18.246 D/Mono ( 2824): [0xb9bd60c0] worker finishing
    The thread '' (0x5) has exited with code 0 (0x0).
    04-14 21:05:37.002 D/Mono ( 2824): DllImport attempting to load: '/system/lib/liblog.so'.
    04-14 21:05:37.002 D/Mono ( 2824): DllImport loaded library '/system/lib/liblog.so'.
    04-14 21:05:37.002 D/Mono ( 2824): DllImport searching in: '/system/lib/liblog.so' ('/system/lib/liblog.so').
    04-14 21:05:37.002 D/Mono ( 2824): Searching for '__android_log_print'.
    04-14 21:05:37.002 D/Mono ( 2824): Probing '__android_log_print'.
    04-14 21:05:37.002 D/Mono ( 2824): Found as '__android_log_print'.
    04-14 21:05:37.002 I/MonoDroid( 2824): UNHANDLED EXCEPTION:
    04-14 21:05:37.002 I/MonoDroid( 2824): System.AggregateException: One or more errors occurred. ---> System.MissingMethodException: Method 'Looper.get_IsCurrentThread' not found.
    04-14 21:05:37.002 I/MonoDroid( 2824): at Xamarin.Forms.Device.get_IsInvokeRequired () [0x00000] in C:\BuildAgent3\work\aad494dc9bc9783\Xamarin.Forms.Core\Device.cs:32
    04-14 21:05:37.002 I/MonoDroid( 2824): at Xamarin.Forms.Application+d__46.MoveNext () [0x0000a] in C:\BuildAgent3\work\aad494dc9bc9783\Xamarin.Forms.Core\Application.cs:125
    04-14 21:05:37.002 I/MonoDroid( 2824): --- End of inner exception stack trace ---
    04-14 21:05:37.002 I/MonoDroid( 2824): at System.Threading.Tasks.Task.ThrowIfExceptional (Boolean includeTaskCanceledExceptions) [0x00014] in /Users/builder/data/lanes/3053/a94a03b5/source/mono/external/referencesource/mscorlib/system/threading/Tasks/Task.cs:2168
    04-14 21:05:37.002 I/MonoDroid( 2824): at System.Threading.Tasks.Task.Wait (Int32 millisecondsTimeout, CancellationToken cancellationToken) [0x00052] in /Users/builder/data/lanes/3053/a94a03b5/source/mono/external/referencesource/mscorlib/system/threading/Tasks/Task.cs:3218
    04-14 21:05:37.002 I/MonoDroid( 2824): at System.Threading.Tasks.Task.Wait () [0x00000] in /Users/builder/data/lanes/3053/a94a03b5/source/mono/external/referencesource/mscorlib/system/threading/Tasks/Task.cs:3083
    04-14 21:05:37.002 I/MonoDroid( 2824): at Xamarin.Forms.Platform.Android.FormsApplicationActivity.OnStateChanged () [0x00057] in C:\BuildAgent3\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\FormsApplicationActivity.cs:300
    04-14 21:05:37.002 I/MonoDroid( 2824): at Xamarin.Forms.Platform.Android.FormsApplicationActivity.OnStop () [0x00019] in C:\BuildAgent3\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\FormsApplicationActivity.cs:215
    04-14 21:05:37.002 I/MonoDroid( 2824): at Android.App.Activity.n_OnStop (IntPtr jnienv, IntPtr native__this) [0x00009] in /Users/builder/data/lanes/3053/a94a03b5/source/monodroid/src/Mono.Android/platforms/android-21/src/generated/Android.App.Activity.cs:4581
    04-14 21:05:37.002 I/MonoDroid( 2824): at (wrapper dynamic-method) System.Object:94297873-f0f9-4c03-9f45-a1228c83cdee (intptr,intptr)
    04-14 21:05:37.002 I/MonoDroid( 2824): ---> (Inner Exception #0) System.MissingMethodException: Method 'Looper.get_IsCurrentThread' not found.
    04-14 21:05:37.002 I/MonoDroid( 2824): at Xamarin.Forms.Device.get_IsInvokeRequired () [0x00000] in C:\BuildAgent3\work\aad494dc9bc9783\Xamarin.Forms.Core\Device.cs:32
    04-14 21:05:37.002 I/MonoDroid( 2824): at Xamarin.Forms.Application+d__46.MoveNext () [0x0000a] in C:\BuildAgent3\work\aad494dc9bc9783\Xamarin.Forms.Core\Application.cs:125 <---`

  • Matthew.4307Matthew.4307 USMember ✭✭✭

    I'm having issues with the Appearing events firing on Windows 8.1 for Tabbed Page and Master Detail Page, I thought it was a introduced in 2.2 issue until I was able to recreate in 2.1 while building my reproduction solution.

    https://bugzilla.xamarin.com/show_bug.cgi?id=40408

  • AlessandroCaliaroAlessandroCaliaro ITMember ✭✭✭✭✭

    @TheRealJasonSmith I use CarouselView and it works. I have this code in a ContentPage:

    CarouselView cv = new CarouselView ();
    cv.ItemsSource = _lista;
    cv.ItemTemplate = new DataTemplate (typeof(BarcodeTemplate));
    sl.Children.Add (cv);
    

    where

    public ObservableCollection<string>_lista = new ObservableCollection<string>();
    

    and

    public class BarcodeTemplate : ContentView {
    
        public BarcodeTemplate(){
    
            Label l = new Label();
            l.FontSize = 40;
            l.SetBinding (Label.TextProperty,".");
            Content = l;
        }
    }
    

    I fill the _lista with a webservice but the CarouselView is not updated correctly. To update the CarouselView I have to swipe from left to right or from right to left. How can I have the CarouselView updated immediately after the WS has changed the _lista? Do I implement INotifyPropertyChanged (If I use the same code with ListView with ViewCell instead of ContentView, I don't have to use INotifyPropertyChanged)

    This is a video that explain the problem. When I insert a Text in the Entry and press Enter on the keyboard, I receive data from WS and fill "_lista" but the first view of the CarouselView is not updated (remains "EMPTY"). If I swype to right and the to left, the View is updated

    http://screencast.com/t/YH1gNOvZgVV

    thanks

  • MiguelCervantesMiguelCervantes MXMember ✭✭✭

    @AlessandroCaliaro @TheRealJasonSmith Using a more complex ContentView, CarouselView doesn't show anything

  • RaphaelSchindlerRaphaelSchindler USMember ✭✭✭

    @TheRealJasonSmith Ok, maybe I missed it. But why on earth where the dependenices for GooglePlayServies imbedded so deeply? I can't even remove them!?

  • HannesPreishuberHannesPreishuber DEMember ✭✭

    is there somewhere a documentation, what nuget update version x with xamarin.forms y works.
    Have 600 errors like Fehler CS0117 "Resource.String" enthält keine Definition für "status_bar_notification_info_overflow".
    and even my old project doesnt compile any longer since installed Xamarin.VisualStudio_4.1.0.298
    also update of xamarin.support.design ... downgrade xamarin.forms to 1.5

  • MichaelRumplerMichaelRumpler ATMember ✭✭✭✭✭

    @HannesPreishuber We talked about the errors in the REsource.designer.cs file at the very beginning of this thread.
    XF 2.2 raised the version of the Xamarin.Android.Support.* libraries. This seems to require, that all dependencies need to be compiled with that new version too. If these are open source, then you can compile them yourself. Otherwise you need to ask their supplier for a new version. Until this is there, you need to stay with XF 2.1.
    You don't need to go back to 1.5 unless the new versions introduced any other bugs which you depend upon.

  • HannesPreishuberHannesPreishuber DEMember ✭✭

    it's not about a need to downgrade to 1.5 - it's happening by upgrading the other packets

  • Matthew.4307Matthew.4307 USMember ✭✭✭

    Is there anything Xamarin can do that means we don't feel massive pain with 3rd party libraries caused by the Android.Support.x packages changing? I've faired quite well as I only needed to re-engineer one library, but for some it could be an absolute nightmare.

  • AdamPAdamP AUUniversity ✭✭✭✭✭

    @TheRealJasonSmith - CarouselView is awesome, except found a bug when I switch the MainPage.
    https://bugzilla.xamarin.com/show_bug.cgi?id=40502

    Is there any chance you could add switching the MainPage as a common test scenario. My apps rely on it a lot and it frequently breaks XF :)

Sign In or Register to comment.