Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all 58056 articles
Browse latest View live

picture cropping not working in android

$
0
0

Dears,

Successfully implement image loading from camera or gallery in my project.

But I need to add cropping feature with image loading.
From camera: In UWP cropping is possible, but in android not.

    _mediaFile = await CrossMedia.Current.TakePhotoAsync(new Plugin.Media.Abstractions.StoreCameraMediaOptions
                    {
                        Directory = "Sample",
                        Name = "test.jpg",
                        AllowCropping = true
                    });

From Gallery: I don't know how to add cropping. I tried like camera, but not get lucky.

     _mediaFile = await CrossMedia.Current.PickPhotoAsync();

Currently in UWP camera cropping is possible, in all others cropping is not working...

Can anyone suggest a solution for cropping on all platforms? :)


Maintaining State in Xamarin Forms.

$
0
0

Do we need to preserve the content of every page in Xamarin Forms, in anticipation that the App could be in the background or suspended?

Xamarin Binding to c# generated View

$
0
0

I need to generate many View based on a list of object that is extracted from a DB.

To do this, I must create this views in my TabbedPage view.
I use MessagingCenter for pass the list of object from ViewModel to View,
then I cycle it for create the views and then add them to the stackLayout on the Page.

I need that any view generated in this way is binding to a value of the list,
but I can't do this.

I can binding the value, for sample, to a Label, but when I try to change this value with a Switch, the value on the view isn't update, but in my object model it is.

This is a piece of my full code (XAML.CS):

// WoRigaDett is my object passed like a parameter using MessagingCenter
List<WoRigaDettaglioIntervento> Lista = WoRigaDett.ListaDettaglioIntervento;

foreach (var Dettaglio in Lista) {
 Label OreViaggioStraordinarioLabel = new Label() {HorizontalTextAlignment = TextAlignment.Center};    

   // Is this binding correct?
   OreViaggioStraordinarioLabel.SetBinding(Label.TextProperty, new 
    Binding(path: "OreViaggioStraordinario2", 
     mode: BindingMode.TwoWay, 
     source: Dettaglio ));
[...]

SwitchTecnicoAbilitato.Toggled += ((object sender, ToggledEventArgs e) => { 
  // What I supposed to do here, for change the value correctly?
  Dettaglio.OreViaggioStraordinario2 = new Random().Next(1, 1000);
});

[...]

Container = new Frame() {
    Margin = new Thickness(10, 0, 10, 0),
    Content = Template, // Template is a stackLayout that contains all generated views.
    HasShadow = false,
    CornerRadius = 0,
    Style = (Style)Application.Current.Resources["FrameStyle"],
    HorizontalOptions = LayoutOptions.FillAndExpand
};

// PlaceholderTecnici is a stackLayout
PlaceholderTecnici.Children.Add(Container);

}

Thank you!

Custom UI for progress bar in Xamarin.Forms

$
0
0

I need the custom UI for progress bar in Xamarin.Forms as shown in the image.

Webview navigating event for iFrame in Android

$
0
0

Hi

Webview Navigating (wv_navigating) event is not executing for iFrame in Android. Its executing fine for iOS.

I am using Xamarin Forms.

Any pointers will be helpful.

Regards
Gajendra Salunkhe

Latest Xamarin updates causing my Android app not to work

$
0
0

Hi,

Please help me with this..

I have just updated Xamarin and Visual Studio for Mac to the latest update and now my PCL's Android project is not working but iOS is file..

I have updated all packages but still not working..

This is what I am getting when building the Android project..

[I made it a file because the forum is not accepting too long message]

https://www.softnames.com/temp/Error-Android.rtf

How do I upload PDF and Docs in Xamarin form?

$
0
0

How do I upload PDF and Docs in Xamarin form? I am able to select and upload Image Files thought using MediaPicker though. with out using xlabs

Wrapping text in a tabbed page label

$
0
0

I have 3 tabs and the last tab the title does not show completely. Is there a way to expand the width of the tab label? Or to wrap the text?

`

<TabbedPage.ToolbarItems WidthRequest="150">

</TabbedPage.ToolbarItems>
`


What can Application.Current.Properties do?

$
0
0

Can anyone point me to any decent documentation about Application.Current.Properties? This is a dictionary of objects keyed by strings which Xamarin is supposed to automatically persist between invocations or the app. I started blythly assuming I could put any object in there (I'm on Android only at the moment), but I quickly discovered it did not work for Classes (even when marked [Serializable]) and then that it does not work even for simple enum's. Is it just strings and base numeric types?

I fixed it for enum as follows:

        protected void SaveProperty<T>(string name, T value)
        {   // Not sure exactly what the limitations are for the Type when using Current.Properties
            // as mSettings - Xamerin do not seem to have bothered to document this! Seems OK for strings
            // and base numeric types of any length. Did not work for enum, so I added this capability. Also
            // does not work for classes, even when marked [Serializable].
            if (mSettings == null) return;
            if (typeof(T).IsEnum)
                mSettings[name] = Convert.ChangeType(value, Enum.GetUnderlyingType(typeof(T)));
            else
                mSettings[name] = value;
        }

        protected T RestoreProperty<T>(string name, T def)
        {   // Warning! Unsupported types (see above) may result in Current.Properties being completely
            // empty on restore (i.e. silently prevent ANY persistence, not just the unsupported type).
            if (mSettings == null) return def;
            if (!mSettings.ContainsKey(name)) return def;
            if (typeof(T).IsEnum)
                return (T)Convert.ChangeType(mSettings[name], Enum.GetUnderlyingType(typeof(T)));
            else
                return (T)mSettings[name];
        }

Also I get disturbing hints that this may not work at all when I move from debug to release build on Android. Is this still the case?

Value Converter not working

$
0
0

I have a simple Converter which converts an array of string values to single string object i.e. joins all the strings using a separator. When the app is run, it hits the breakpoint in the value converter but not thereafter. It's not showing the concatenated string in a label as expected.

View:

<ContentPage 
    x:Class="mvvm.Views.LoginPage"
    xmlns:converters="clr-namespace:XFApp.Core.Converters;assembly=XFApp.Core">

    <ContentPage.Resources>
        <ResourceDictionary>
            <converters:ValidationErrorConverter x:Key="validationErrorConverter" />
        </ResourceDictionary>
    </ContentPage.Resources>

    <StackLayout Padding="10,100,10,10">
        <StackLayout>
            <Label 
                Text="{Binding Errors, Converter={StaticResource validationErrorConverter}}" />

            <Label Text="User name:" />
            <Entry x:Name="entryUsername" Keyboard="Email" Text="{Binding Username, Mode=TwoWay}" Style="{StaticResource EntryStyle}" />

            <Label Text="Password:" />
            <Entry x:Name="entryPassword" IsPassword="true" Text="{Binding Password, Mode=TwoWay}" Style="{StaticResource EntryStyle}" />
        </StackLayout>
        <Button VerticalOptions="EndAndExpand" Text="LOGIN" Command="{Binding AuthenticateUserCommand}" />
    </StackLayout>
</ContentPage>

View Code Behind:

using mvvm.ViewModels;
using Xamarin.Forms;

namespace mvvm.Views
{
    public partial class LoginPage : ContentPage
    {
        LoginViewModel viewModel = new LoginViewModel();

        public LoginPage()
        {
            InitializeComponent();

            this.BindingContext = viewModel;
        }
    }
}

ViewModel:

using System.Windows.Input;
using Xamarin.Forms;
using mvvm.Models;
using System.Collections.Generic;
using XFApp.Core.ViewModels;

namespace mvvm.ViewModels
{
    public class LoginViewModel : ViewModelBase
    {
        private string _username;
        private string _password;
        private bool _isValid;
        private IList<string> _errors;

        public LoginViewModel()
        {
            _username = "";
            _password = "";

            _errors = new List<string>();
        }

        public IList<string> Errors
        {
            set { SetProperty(ref _errors, value); }
            get { return _errors; }
        }

        public string Username { 
            set { 
                SetProperty(ref _username, value);
                ((Command)AuthenticateUserCommand).ChangeCanExecute();
            }
            get { return _username; }
        }

        public string Password
        {
            set { 
                SetProperty(ref _password, value);
                ((Command)AuthenticateUserCommand).ChangeCanExecute();
            }
            get { return _password; }
        }

        public bool IsValid
        {
            set { SetProperty(ref _isValid, value); }
            get { return _isValid; }
        }

        public ICommand AuthenticateUserCommand => new Command(
            execute: () => {
                AuthenticateUserAsync();
            }
            //,
            //canExecute: () => {
            //    return (Username.Length > 0);
            //}
        );

        private bool Validate()
        {
            if (_username == "")
            {
                _errors.Add("An e-mail address is required.");
                Errors = _errors;
            }

            if (_password == "")
            {
                _errors.Add("A password is required.");
                Errors = _errors;
            }

            return _errors.Count == 0;
        }

        private async void AuthenticateUserAsync()
        {
            Errors.Clear();

            IsValid = true;
            bool isValid = Validate();
            bool isAuthenticated = false;
            Token token = null;

            if (!isValid)
            {
                IsValid = false;
                return;
            }

            token = await Services.UserService.IsValidUser(_username, _password);
            if (token != null)
                isAuthenticated = true;

            if (isAuthenticated)
            {
                //new Messenger().Subscribe<LoginFailedMessage>(this, loginPage.LoginFailed);
                //MainPage = new NavigationPage(new mvvmPage());
            }
            else
            {
                //Errors.Clear();
                //Errors.Add("Invalid credentials.");
            }
        }
    }
}

Converter:

using System;
using System.Collections.Generic;
using System.Globalization;
using Xamarin.Forms;

namespace XFApp.Core.Converters
{
    public class ValidationErrorConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            List<string> errors = value as List<string>;
            return errors != null && errors.Count > 0 ? string.Join("\r\n", errors.ToArray()) : "";
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}

ViewModelBase:

using System;
using System.ComponentModel;
using System.Runtime.CompilerServices;

namespace XFApp.Core.ViewModels
{
    public class ViewModelBase : INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;

        protected bool SetProperty<T>(ref T storage, T value,
                                      [CallerMemberName] string propertyName = null)
        {
            if (Object.Equals(storage, value))
                return false;

            storage = value;
            OnPropertyChanged(propertyName);
            return true;
        }

        protected void OnPropertyChanged([CallerMemberName] string propertyName = null)
        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
        }
    }
}

is it possible to extend ViewTableCell and use it as base type for ViewCellRenderer (iOS\XF)

$
0
0

Hi!
I need to extend existing implementation of ViewTableCell that is used as base type for UITableViewCell, but current implementation of ViewCellRenderer doesn't allow me to do this because of private modifier on the class and, probably, protected virtual UITableViewCell CreateNativeCell(...).
https://github.com/xamarin/Xamarin.Forms/blob/master/Xamarin.Forms.Platform.iOS/Cells/ViewCellRenderer.cs
Is it possible to do it in a somehow? Maybe using the reflection or assembly patching?
Or I should change the source code and create a pull request (will it be accepted)?
I don't understand the reason why the current ViewCellRenderer implemented in this way - it's so 'vendor-locked' in the code, nobody can use ios's TableView Cell's features such as override SetHighlighted method, etc.
Probably I can copy-paste necessary classes such as ViewCellRenderer to my project but it's a wrong way so I'm not going to do that.

TEditor not working in android

$
0
0

Hi Everyone.I am implementing TEditor in a project in xamarin forms.There are no errors in code and building successfully.It is working fine in Simulator.But in real devices the data is not getting typed and also the styles are not working.

The project contains MasterDetailPage in Android.Can anyone of you please give me an idea to get my problem solved.

Or

Any one please suggest me another Plugin or Component or Package for the replacement of TEditor.

Thanks in Advance

is it possible to extend ViewTableCell and use it as base type for ViewCellRenderer (iOS\XF)

$
0
0

Hi!
I need to extend existing implementation of ViewTableCell that is used as base type for UITableViewCell, but current implementation of ViewCellRenderer doesn't allow me to do this because of private modifier on the class and, probably, protected virtual UITableViewCell CreateNativeCell(...).
https://github.com/xamarin/Xamarin.Forms/blob/master/Xamarin.Forms.Platform.iOS/Cells/ViewCellRenderer.cs
Is it possible to do it in a somehow? Maybe using the reflection or assembly patching?
Or I should change the source code and create a pull request (will it be accepted)?
I don't understand the reason why the current ViewCellRenderer implemented in this way - it's so 'vendor-locked' in the code, nobody can use ios's TableView Cell's features such as override SetHighlighted method, etc.
Probably I can copy-paste necessary classes such as ViewCellRenderer to my project but it's a wrong way so I'm not going to do that.

How to add red asterisk for a label

$
0
0

Hi,

I want to add red asterisk for every label text in grid. may i know how to add this control? Thanks

Issue with async calls in ViewModel causes crash on iOS but not on Android

$
0
0

I have an app where the first screen the user sees is a master detail page with a list and a menu. At least after the splash screen, that is.
The page is initialized as such:

var detailPage = (Page)this.componentContext.Resolve(pageType); // This is the page with the list
var page = (Page)this.componentContext.Resolve(typeof(MainPage)); // This is the menu page
var newPage = page as MasterDetailPage; 
newPage.Master = menuPage;
newPage.Detail = newDetailPage;
MainPage = newPage;
await this.InitializePage(detailPage); // Calls the ViewModel

public MasterDetailPage MainPage
    {
        get => Application.Current.MainPage as MasterDetailPage;
        set => Application.Current.MainPage = value;
    }

At this point, the ViewModel has been initialized and the following method in the ViewModel is called:

public override async Task InitializeAsync()
    {
        if (!this.isInitialized)
        {
            await this.eventBus.Send(new PopulateListEvent()); // This is the call that generates the error. Works on Android
            this.isInitialized = true;
        }
    }

The problem I face is when the await call is made, the app terminates on iOS (but not on Android) and I get a null reference exception with no inner text.
If I remove the await call, the page loads just fine, but with an empty list of course.

So it seems the problem lies within the way iOS deals with calls before the page is actually loaded.

Any ideas?


Image Circle

$
0
0

Hi I am using a renderer for creating a circle image however i am unable to give backround color to that image as ther is no space between the circle border and the image.
PFA the images attached.

Code that i am using is :-1:
XAML-

Renderer:-
var radius = Math.Min(Width, Height) / 2;
var strokeWidth = 10;
radius -= strokeWidth / 2;

        //Create path to clip
        var path = new Path();
        path.AddCircle(Width / 2, Height / 2, radius, Path.Direction.Ccw);
        canvas.Save();
        canvas.ClipPath(path);

        var result = base.DrawChild(canvas, child, drawingTime);

        canvas.Restore();

        // Create path for circle border
        path = new Path();
        path.AddCircle(Width / 2, Height / 2, radius, Path.Direction.Ccw);

        var paint = new Paint();
        paint.AntiAlias = true;
        paint.StrokeWidth = 5;
        paint.SetStyle(Paint.Style.Stroke);
        paint.Color = global::Android.Graphics.Color.Gray;


        //paint.Color = Element.BorderColor;
        canvas.DrawPath(path, paint);

        //Properly dispose
        paint.Dispose();
        path.Dispose();
        return result;

ScrollToAsync not working on iOS page load

$
0
0

Hello all,
I'm currently having an issue with ScrollToAsync malfunctioning only on iOS. I have called ScrollToAsync with both overloads and everything has worked fine on Android but never seems to work on iOS. I have debugged the code and it is definitely getting called without exceptions.
If I call ScrollToAsync after the page load it works as intended.
Here is my code:

public class ConversationViewPage : MyStylePage
{
    Entry _messageEntry = null;
    Button _sendButton = null;
    StackLayout _messageLayout = null;
    ScrollView _messageScrollView = null;
    static Element _latestDetail = null;

    public ConversationViewPage(Conversation conversation)
    {
        _latestDetail = null;

        _messageEntry = new Entry
        {
            Placeholder = "Message...",
            VerticalOptions = LayoutOptions.End
        };
        _messageEntry.Focused += _messageEntry_Focused;

        _sendButton = new Button
        {
            Text = "Send",
            VerticalOptions = LayoutOptions.End
        };
        _sendButton.Clicked += _sendButton_Clicked;
        _messageEntry.Completed += _sendButton_Clicked;

        var stackLayout = new StackLayout
        {
            Padding = new Thickness(0, 20, 0, 0)
        };

        _messageLayout = new StackLayout
        {
            VerticalOptions = LayoutOptions.EndAndExpand
        };

        _messageScrollView = new ScrollView
        {
            VerticalOptions = LayoutOptions.EndAndExpand,
            Content = _messageLayout,
            Margin = new Thickness(5, 5)
        };
        _messageScrollView.SizeChanged += _messageScrollView_SizeChanged;

        stackLayout.Children.Add(_messageScrollView);
        stackLayout.Children.Add(_messageEntry);
        stackLayout.Children.Add(_sendButton);

        Content = stackLayout;
    }

    private async void _messageScrollView_SizeChanged(object sender, EventArgs e)
    {
        var stender = (ScrollView)sender;
        if (stender.ContentSize.Height > stender.Height && _latestDetail != null)
            await stender.ScrollToAsync(_latestDetail, ScrollToPosition.End, false); //Does not work on iOS. Does work on Android.
    }

    private async void _messageEntry_Focused(object sender, FocusEventArgs e)
    {
        await scrollToBottomOfMessages(); //This works perfectly
    }

    protected async override void OnAppearing()
    {
        base.OnAppearing();

        await populatePage();
    }

    private async Task populatePage()
    {
        var contents = GetAllMyData();

        _messageLayout.Children.Clear();

        foreach (var content in contents.OrderBy(x => x.TimeStamp))
        {
            var sender = this.Users.Single(u => u.Id == content.SenderId);
            var senderName = sender.FirstName + ' ' + sender.LastName;
            var detail = new ConversationDetail(content);
            _latestDetail = detail;

            _messageLayout.Children.Add(detail);
        }

        await scrollToBottomOfMessages(); //Does not work on iOS.
    }

    private async Task scrollToBottomOfMessages()
    {
        if (_latestDetail != null)
            await _messageScrollView.ScrollToAsync(_latestDetail, ScrollToPosition.End, false); //Does not work on page load in iOS
    }

    private async void _sendButton_Clicked(object s, EventArgs e)
    {
        var message = _messageEntry.Text.Trim();
        if (message.Length > 0)
        {
            _messageEntry.Text = string.Empty;

            var activityIndicator = new ActivityIndicator
            {
                IsRunning = true,
                IsEnabled = true
            };
            _messageLayout.Children.Add(activityIndicator);
            _latestDetail = activityIndicator;
            await scrollToBottomOfMessages(); //Works perfectly

            var sender = this.Users.Single(u => u.Id == addedMessage.SenderId);
            var senderName = sender.FirstName + ' ' + sender.LastName;

            var conversationDetail = new ConversationDetail(addedMessage);

            await AddNewMessageToDatabase(conversationDetail);

            _messageLayout.Children.Add(conversationDetail);
            _latestDetail = conversationDetail;
            _messageLayout.Children.Remove(activityIndicator);

            await scrollToBottomOfMessages(); //Works perfectly
        }
    }
}

Any ideas?

Xamarin IOS App Crash In Store and works in TestFlight

$
0
0

As the title states, my application works great in TestFlight for all of the users, however when I submit to the store it crashes on startup. I have the crash logs and will post them below but I am running out of ideas on what the deal is with this. Any ideas would be appreciated. The app also works fine in debug mode on my simulator or IPhone.

Thread 0 name: tid_303 Dispatch queue: com.apple.main-thread Thread 0 Crashed:
0 libsystem_kernel.dylib 0x0000000185a9d348 pthread_kill + 8
1 libsystem_pthread.dylib 0x0000000185bb1354 pthread_kill$VARIANT$mp + 396
2 libsystem_c.dylib 0x0000000185a0cfd8 abort + 140
3 AppWinbid.iOS 0x00000001016930c0 mono_handle_native_crash + 16134336 (mini-exceptions.c:2548)
4 libsystem_platform.dylib 0x0000000185babb60 _sigtramp + 52
5 libsystem_pthread.dylib 0x0000000185bb1354 pthread_kill$VARIANT$mp + 396
6 libsystem_c.dylib 0x0000000185a0cfd8 abort + 140
7 AppWinbid.iOS 0x0000000101792488 xamarin_printf + 17179784 (runtime.m:2218)
8 AppWinbid.iOS 0x00000001016cf1d8 mono_invoke_unhandled_exception_hook + 16380376 (exception.c:1084)
9 AppWinbid.iOS 0x0000000101692d18 mono_handle_exception_internal + 16133400 (mini-exceptions.c:1886)
10 AppWinbid.iOS 0x0000000101691d50 mono_handle_exception + 16129360 (mini-exceptions.c:2117)
11 AppWinbid.iOS 0x000000010168a6d8 mono_arm_throw_exception + 16099032 (exceptions-arm64.c:411)
12 AppWinbid.iOS 0x0000000100a03878 throw_exception + 168
13 AppWinbid.iOS 0x00000001008fe35c System_Runtime_ExceptionServices_ExceptionDispatchInfo_Throw + 44
14 AppWinbid.iOS 0x0000000100900da4 System_Runtime_CompilerServices_AsyncMethodBuilderCore__c__ThrowAsyncb__6_0_object + 84
15 AppWinbid.iOS 0x0000000100a99968 UIKit_UIKitSynchronizationContext__Postc__AnonStorey0__m__0 + 3578216 (UIKitSynchronizationContext.cs:24)
16 AppWinbid.iOS 0x0000000100a73e04 Foundation_NSAsyncActionDispatcher_Apply + 3423748 (NSAction.cs:163)
17 AppWinbid.iOS 0x00000001009d3744 wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr + 244
18 AppWinbid.iOS 0x00000001016a038c mono_jit_runtime_invoke + 16188300 (mini-runtime.c:2526)
19 AppWinbid.iOS 0x0000000101705544 do_runtime_invoke + 16602436 (object.c:2829)
20 AppWinbid.iOS 0x00000001017054a4 mono_runtime_invoke + 16602276 (object.c:2983)
21 AppWinbid.iOS 0x00000001007346e8 native_to_managed_trampoline_3(objc_object*, objc_selector*, _MonoMethod**, unsigned int) + 18152 (registrar.m:106)
22 AppWinbid.iOS 0x0000000100734bec -[__MonoMac_NSAsyncActionDispatcher xamarinApplySelector] + 19436 (registrar.m:6968)
23 Foundation 0x0000000186973a50 __NSThreadPerformPerform + 340
24 CoreFoundation 0x0000000185f2c358 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION
+ 24
25 CoreFoundation 0x0000000185f2c2d8 CFRunLoopDoSource0 + 88
26 CoreFoundation 0x0000000185f2bbb4 __CFRunLoopDoSources0 + 288
27 CoreFoundation 0x0000000185f29738 __CFRunLoopRun + 1048
28 CoreFoundation 0x0000000185e4a2d8 CFRunLoopRunSpecific + 436
29 GraphicsServices 0x0000000187cdbf84 GSEventRunModal + 100
30 UIKit 0x000000018f3f7880 UIApplicationMain + 208
31 AppWinbid.iOS 0x0000000100afc470 wrapper_managed_to_native_UIKit_UIApplication_UIApplicationMain_int_string___intptr_intptr + 3982448 (/:1)
32 AppWinbid.iOS 0x0000000100a92e9c UIKit_UIApplication_Main_string___intptr_intptr + 3550876 (UIApplication.cs:79)
33 AppWinbid.iOS 0x0000000100a92e5c UIKit_UIApplication_Main_string___string_string + 3550812 (UIApplication.cs:63)
34 AppWinbid.iOS 0x0000000100755174 AppWinbid_iOS_Application_Main_string
+ 151924 (/:1)
35 AppWinbid.iOS 0x00000001009d3744 wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr + 244
36 AppWinbid.iOS 0x00000001016a038c mono_jit_runtime_invoke + 16188300 (mini-runtime.c:2526)
37 AppWinbid.iOS 0x0000000101705544 do_runtime_invoke + 16602436 (object.c:2829)
38 AppWinbid.iOS 0x0000000101707f48 do_exec_main_checked + 16613192 (object.c:4623)
39 AppWinbid.iOS 0x0000000101689ef0 mono_jit_exec + 16097008 (driver.g.c:1040)
40 AppWinbid.iOS 0x000000010179648c xamarin_main + 17196172 (monotouch-main.m:0)
41 AppWinbid.iOS 0x00000001007550c8 main + 151752 (main.m:85)
42 libdyld.dylib 0x000000018596e56c start + 4

Opacity not working

$
0
0

I want to set the Opacity for a BoxView:

but the rendered color is a solid black:

to see how it behaves I bound the opacity value to a Slider's Value:

<StackLayout x:Name="stk">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition/>
                    <RowDefinition/>
                    <RowDefinition/>
                </Grid.RowDefinitions>
                <local:RadioButtonsGroup x:Name="rbs" SelectedValuePath="Id" DisplayMemberPath="Name" FontAttributes="Bold" FontFamily="Droid Sans Mono" FrontColor="#2061D8"/>
                <Label HorizontalOptions="CenterAndExpand" FontSize="Large" TextColor="Black" Text="{Binding SelectedValue, Source={x:Reference rbs}}"/>
                <BoxView HeightRequest="100" WidthRequest="150" BackgroundColor="Black" Opacity="{Binding Value, Source={x:Reference sd}}" HorizontalOptions="Center" VerticalOptions="Center"/>
                <Slider x:Name="sd" Grid.Row="1"/>
                <Label Text="{Binding Value, Source={x:Reference sd}}" Grid.Row="2"/>
            </Grid>
        </StackLayout>

Double tap/click problem

$
0
0

I have some clickable element (list item, button) and when i click on this element it fires method which pushes to another page (calls PushModalAsync).
The problem is when I calling PushModalAsync with animation attribute set to false (PushModalAsync(new SomePage(), false)), I can accidentaly make double click on the element, so it will push 2 pages instead of one. I made the wrapper, which blocks execution of method, when it's calling now, but still it didn't help at all. This wrapper works only when animation is set to true. Here is a sample project, where you can reproduce this bug:
https://github.com/Saratsin/PushPopAsync

Here is video where this bug is reproducing:
image

Does anybody have idea how to solve this bug?

Viewing all 58056 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>