Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all 204402 articles
Browse latest View live

ViewCell.ContextActions is not working for Xamarin.iOS.

$
0
0

Hello Guys,

I am using ListView control for listing some records.
Also I have used "ViewCell.ContextActions" for delete list item.
This is working fine on Android, but for iOS it is not working.

Whenever I will call the ListView page, the application does nothing also it is not showing any exception.

<ListView x:Name="list" ItemSelected="OnSelection" ItemTapped="OnTap" IsPullToRefreshEnabled="true" Refreshing="OnRefresh"> <ListView.ItemTemplate> <DataTemplate> <ViewCell> <ViewCell.ContextActions> <MenuItem Clicked="OnMore" Text="More" CommandParameter="{Binding .}" /> <MenuItem Clicked="OnDelete" Text="Delete" IsDestructive="true" CommandParameter="{Binding .}" /> </ViewCell.ContextActions> <StackLayout Padding="15,0"> <Label Text="{Binding .}" /> </StackLayout> </ViewCell> </DataTemplate> </ListView.ItemTemplate> </ListView>


(Storyboard) Possible doing design of a custom view in one controller, and re-use it in different?

$
0
0

Good day all,

I am used to create a custom view in a class by code, and re-use this custom classed view in different controllers.

However; it would save me some time if I could do the design in a certain designViewController on a storyboard and then use this custom class elsewhere in a different viewcontroller.

When I now use UITableStyleButton.cs it gives me a blank view.

How to add emojis in a chat view in xamarin.forms

$
0
0

How to add emojis in a chat view in xamarin.forms...just like in message sender or in whats app there is symbol around a text box to view and select emojis.

InvalidProjectFileException: Cycle in target dependencies detected.Build failed

$
0
0

Here is error message:

/Project/DASSolutionFinder/Droid/DASSolutionFinder.Droid.csproj (Build) ->: error : Error building target _XamarinAndroidBuildAarProguardConfigs: Microsoft.Build.BuildEngine.InvalidProjectFileException: Cycle in target dependencies detected
at Microsoft.Build.BuildEngine.Target.BuildOtherTargets (System.Collections.Generic.IEnumerable1[T] targetNames, System.Action1[T] missing_target, System.Boolean& executeOnErrors) [0x00065] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Target.cs:263
at Microsoft.Build.BuildEngine.Target.BuildDependencies (System.Boolean& executeOnErrors) [0x0003f] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Target.cs:211
at Microsoft.Build.BuildEngine.Target.BuildActual (System.String built_targets_key, System.Boolean& executeOnErrors) [0x00091] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Target.cs:177

what should I do ?

Delete button inside ListView

$
0
0

I had created a listView with a Delete button inside it. But When I click on Delete button it doesn't fires? What can be the reason.

Extending the NSBundle class

$
0
0

Hi.

I'm trying to override the method string LocalizedString(string key, string value, string table) in the MainBundle. I would like to intercept how strings get resolved when they are defined in a localization file such as Main.strings (for the storyboard main.storyboard) inside the Base.lproj folder. This is a requirement because localizations can be defined on a remote server and the app has to handle this as well as the different localization files.

My attempt is therefore to initialize the storyboard with my custom bundle, override the GetString, and pray that this call is executed when the storyboard localizations are loaded. But right now I cannot find a way to override the MainBundle with my own class because bundles are initialize from the NSBundle.FromBundle(...) call and thus i cannot provide it to the base constructor of my CustomBundle class.

Example:
I have a UI control with the localization id "aa-bb". The Main.strings has the line "aa-bb.text" = "@mykey";. Right now the text is set to "@mykey" literally, but I would like to look up @mykey using some method, resolve it , and return the text so the UI control text is set to what I return.

Ideas? Suggestions?

Removing an item from Listview causes all items below it to flash on Android

$
0
0

This only happens on Android, I have an animation that sets the height, margin, padding spacing of the StackView in the ViewCell and the Height of the ViewCell to 0. I even added a delay to make sure that the position of lower elements didn't change. And indeed, the elements below the removed element didn't change, but they all just flashed. The same happens when I move that itme to the end of the List. I've had to just hide the element instead of removing it. How can this be overcome? Or is there a way I can create a class that implements an Observable Collection, create a delete method that doesn't trigger the Collection Changed event? Thanks

Space Above and Below Grouped UITableView

$
0
0

I have a grouped UITableView, overriding GetViewForHeader() and GetHeightForHeader() (same for footer). It seems to be working, as noted by the blue area in the footer. But why is there so much gray space above the header and below the footer? Is that normal for a grouped table? If not, how can I get rid of it?

Thanks...

`
public override UIView GetViewForFooter (UITableView tableView, nint section)
{
UIView v = new UIView (new CoreGraphics.CGRect (0, 0, 200, 10));
v.BackgroundColor = UIColor.Blue;

        return v;
    }

    public override nfloat GetHeightForFooter (UITableView tableView, nint section)
    {
        return 10;
    }

`


The Android SDK could not be found. Make sure the path to the SDK is correctly configured in the Xam

$
0
0

I installed Xamarin.Andriod manually. The simple android application is working fine with out any problem using Visual Studio 2012. But when I try to open the Main.axml page in VS2012, am getting the following error

The Android SDK could not be found. Make sure the path to the SDK is correctly configured in the Xamarin studio options and that you have installed the platform tools and at least one platform SDK.

Even, I am not able to manually edit the Main.axml file in the VS IDE. Have I missed anything, Should I install any other tool? Please refer the attached screenshots. I can run the android program and it's working fine in the emulator, but not able to edit the design in VS2012

Let's talk performance

$
0
0

As we continue to release performance focused features and fixes, and build processes around performance, I want to have a thread dedicated to those items.

Our public roadmap itemizes the feature work we are doing and planning to do, and items related to performance are tagged. In addition to that, we are building into our CI processes ways to measure and compare performance metrics. The goal is that with specific commits and builds we can get visibility to any impact on speed and memory usage.

One of the initiatives I'm spearheading is to populate a solution with UIs that are representative of your applications. To that end, I'm asking you to consider sharing those layouts with us. Perhaps the best way to gather them would be to open a repository and have you submit pull requests. I'll get working on that next and post details here.

Fast Renderers for Android are now merged and in nightly and will be our next pre-release. I hope some of you will take some time to test them out and report back here with your findings.

In initialize component i was facing exception that Cannot convert from "" to system.double.

$
0
0

Please hele me thanks in advance

Listview detect scroll state

$
0
0

How to detect scroll state in xamarin forms listview?
Similar approch in android with OnScrollStateChanged

How to exit application

$
0
0

How to exit application in xamarin forms when i press double times?

Capture digital handwriting, save and retrieve the handwriting.

$
0
0

I'm in developing a Xamarin Forms App that need a handwriting feature. I could do the both of drawing and generating the bytes from it. But I had been stuck for more than two weeks to save and view handwring as image.
Can anybody help? Thanks in advice.

NavigationPage.SetTitleIcon - works on iOS but not Android

$
0
0

Hello,
I added the following..

NavigationPage.SetTitleIcon(this, "LogoLocales.png");

Looks like it should work fine, but only works on iOS not Android.

Any ideas?


Authenticate requests from xamarin.forms to aws API Gateway with Cognito jwt token

$
0
0

I am trying to authenticate requests from xamarin.forms app to aws API Gateway. Users are authenticated from a user pool and I am able to receive id/access/refresh tokens at the authentication.

I do not understand how to sign requests against the api gateway with the xamarin sdk.

This functionality is supported by the sdk?

Otherwise I could authenticate requests with aws signature v4. Even in this case I can't figure out how to use the tokens I receive from cognito to obtain the session token

from the docs (http://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html):

Note You can use temporary security credentials provided by the AWS Security Token Service (AWS STS) to sign a request. The process is the same as using long-term credentials, but when you add signing information to the query string you must add an additional query parameter for the security token. The parameter name is X-Amz-Security-Token, and the parameter's value is the URI-encoded session token (the string you received from AWS STS when you obtained temporary security credentials).
How can I build the v4 signature headers using Cognito tokens?

stack overflow question: https://stackoverflow.com/questions/44943793/authenticate-requests-from-xamarin-forms-to-aws-api-gateway-with-cognito-jwt-tok

How to send arguments from ViewCell.Tapped event to next page

$
0
0

I'm working on a simple application to get to know some of the Xamarin basics. Now I'm stuck when switching pages, as I want to send a variable ID to the next page, to enable that page to retrieve the right data.

I've added the tapped property to the ViewCell, and refer to the CategoryClicked class. Then I am looking to get the ID of the selected ViewCell. But I cannot find it in the EventArgs.

What would be the right way to do this?

Currently I have the following code (i simplified it a bit)

CardCategories.xaml

<ContentPage.Content>
        <StackLayout>
            <ListView x:Name="CardCategoriesListView" RowHeight="100">
                <ListView.ItemTemplate>
                    <DataTemplate>
                        <ViewCell Tapped="CategoryClicked">
                            <StackLayout BackgroundColor="{Binding Color}" Orientation="Horizontal">
                                <Label
                                    Margin="20"
                                    FontSize="30"
                                    HorizontalOptions="Start"
                                    Text="{Binding Icon}"
                                    TextColor="White"
                                    VerticalOptions="CenterAndExpand">
                                    <Label.FontFamily>
                                        <OnPlatform x:TypeArguments="x:String">
                                            <OnPlatform.iOS>MaterialIcons-Regular</OnPlatform.iOS>
                                            <OnPlatform.Android>Fonts/MaterialIcons-Regular.ttf#MaterialIcons-Regular</OnPlatform.Android>
                                            <OnPlatform.WinPhone>Assets/Fonts/MaterialIcons-Regular.ttf#MaterialIcons-Regular</OnPlatform.WinPhone>
                                        </OnPlatform>
                                    </Label.FontFamily>
                                </Label>
                </StackLayout>
                        </ViewCell>
                    </DataTemplate>
                </ListView.ItemTemplate>
            </ListView>
        </StackLayout>
    </ContentPage.Content>
</ContentPage>

CardCategories.xaml.cs

namespace UXCards
{
    [XamlCompilation(XamlCompilationOptions.Compile)]
    public partial class CardCategories : ContentPage
    {
        public CardCategories()
        {
            InitializeComponent();
            CardCategoriesListView.ItemsSource = ViewModel.UXCardsViewModel.uxCardCategories;
        }

        async void CategoryClicked(object sender, SelectedItemChangedEventArgs e)
        {

            var cardSubCategory = new CardSubCategories();
            cardSubCategory.CategorySelected = 0; // Here I want to send the ID to the next page

            await Navigation.PushAsync(cardSubCategory);
        }
    }
}

Xamarin.Forms with Xamarin.Auth on Android/iOS

$
0
0

Hi,
I am an experienced developer, but a Mobile n00b trying to find my way into this Mobile jungle. I am hoping to find some help to guide me in the right direction.

I have searched in circles for a while now for working examples on how to build a simple Xamarin.Forms Android/iOS mobile app that uses Xamarin.Auth (1.4.0) to authenticate with Google with the new policy. So far I have ended up in most back alleys of the internet and my frustration is growing bigger by the minute.

most examples I find are outdated, because they use the WebView (internal browser) approach and not native browser approach. Most examples are incomplete in regards to how the complete code is both structured and actually working. I find tons of code fragments, but none that really works.

Does anyone know of a simple "plug and play" example of a Xamarin.Forms/Xamarin.Auth application that is working with Googles new sign-in policy?`

Regards,
K

Xamarin.Forms iOS error Selector name found in current argument registers: configureAnimation:forLay

$
0
0

Hello,

I have been experiencing a problem with my Xamarin Forms application when deploying it on iOS, where it crashes suddenly while I'm using it.

I noticed that the crash happens mostly when I'm:

  • working with the multiple pickers (filling some form data)
  • going through pages reasonably fast (it's a questionnaire, so users are supposed to navigate forward kind of fast).

This is some portions of the Crash report I captured on HockeyApp:

Hardware Model:      iPad6,11
...
Parent Process:  ??? [1]

Date/Time:       2017-06-30T11:54:16Z
Launch Time:     2017-06-30T11:42:03Z
OS Version:      iPhone OS 10.3.2 (14F90)
Report Version:  104

Exception Type:  SIGSEGV
Exception Codes: SEGV_ACCERR at 0x10
Crashed Thread:  15

Application Specific Information:
Selector name found in current argument registers: configureAnimation:forLayer:forKey:
...

I also noticed that this crash only happens to me when using OS 10.3 I updated my Xamarin.Forms to 2.3.4.247 but nothing changed.

This is the Native stacktrace i got on visual studio 2017 when debugging on a Simulator

MIRE_v2.iOS                         0x0000000101b195c1 mono_handle_native_crash + 257
MIRE_v2.iOS                         0x0000000101b255c0 mono_sigsegv_signal_handler + 288
libsystem_platform.dylib            0x000000010ea23b3a _sigtramp + 26
???                                 0x00007fdc4f00163c 0x0 + 140584194938428
UIKit                               0x00000001025934c8 -[UIViewAnimationState actionForLayer:forKey:forView:] + 99
UIKit                               0x00000001025be87e +[UIView(Animation) _defaultUIViewActionForLayer:forKey:] + 111
UIKit                               0x0000000102d9d3e4 -[UIView(UIKitManual) actionForLayer:forKey:] + 119
QuartzCore                          0x00000001086014bc -[CALayer actionForKey:] + 437
QuartzCore                          0x00000001085fcade _ZL12actionForKeyP7CALayerPN2CA11TransactionEP8NSString + 76
QuartzCore                          0x00000001085fca6c _ZN2CA5Layer12begin_changeEPNS_11TransactionEjRP11objc_object + 140
QuartzCore                          0x00000001085fce04 _ZN2CA5Layer6setterEj12_CAValueTypePKv + 164
QuartzCore                          0x0000000108608351 -[CALayer setOpacity:] + 43
MIRE_v2.iOS                         0x0000000101cc9d79 xamarin_dyn_objc_msgSend + 217
???                                 0x00000001269fc8f4 0x0 + 4942973172
???                                 0x0000000126b13b4d 0x0 + 4944116557
???                                 0x00000001266a291c 0x0 + 4939458844
MIRE_v2.iOS                         0x0000000101b28525 mono_jit_runtime_invoke + 1301
MIRE_v2.iOS                         0x0000000101bd9b58 do_runtime_invoke + 88
MIRE_v2.iOS                         0x0000000101c1b4da start_wrapper + 538
MIRE_v2.iOS                         0x0000000101c9cdcd inner_start_thread + 189
libsystem_pthread.dylib             0x000000010ea3593b _pthread_body + 180
libsystem_pthread.dylib             0x000000010ea35887 _pthread_body + 0
libsystem_pthread.dylib             0x000000010ea3508d thread_start + 13

And this is a little portion from the crash log of a Mac on which the simulator is running (the thread that crashed, the log is very long):

Thread 10 Crashed:: tid_7327
0   libsystem_kernel.dylib          0x000000010ea00d42 __pthread_kill + 10
1   libsystem_pthread.dylib         0x000000010ea38457 pthread_kill + 90
2   libsystem_c.dylib               0x000000010e79288f abort + 127
3   com.sf.rf                       0x0000000101b19737 mono_handle_native_crash + 631 (mini-exceptions.c:2560)
4   com.sf.rf                       0x0000000101b255c0 mono_sigsegv_signal_handler + 288 (mini-runtime.c:2870)
5   libsystem_platform.dylib        0x000000010ea23b3a _sigtramp + 26
6   ???                             0x00007fdc4f00163c 0 + 140584194938428
7   com.apple.UIKit                 0x00000001025934c8 -[UIViewAnimationState actionForLayer:forKey:forView:] + 99
8   com.apple.UIKit                 0x00000001025be87e +[UIView(Animation) _defaultUIViewActionForLayer:forKey:] + 111
9   com.apple.UIKit                 0x0000000102d9d3e4 -[UIView(UIKitManual) actionForLayer:forKey:] + 119
10  com.apple.QuartzCore            0x00000001086014bc -[CALayer actionForKey:] + 437
11  com.apple.QuartzCore            0x00000001085fcade actionForKey(CALayer*, CA::Transaction*, NSString*) + 76
12  com.apple.QuartzCore            0x00000001085fca6c CA::Layer::begin_change(CA::Transaction*, unsigned int, objc_object*&) + 140
13  com.apple.QuartzCore            0x00000001085fce04 CA::Layer::setter(unsigned int, _CAValueType, void const*) + 164
14  com.apple.QuartzCore            0x0000000108608351 -[CALayer setOpacity:] + 43
15  com.sf.rf                       0x0000000101cc9d79 xamarin_dyn_objc_msgSend + 217 (.trampolines-x86_64-objc_msgSend-post.inc:3)
16  ???                             0x00000001269fc8f4 0 + 4942973172
17  ???                             0x0000000126b13b4d 0 + 4944116557
18  ???                             0x00000001266a291c 0 + 4939458844
19  com.sf.rf                       0x0000000101b28525 mono_jit_runtime_invoke + 1301 (mini-runtime.c:2533)
20  com.sf.rf                       0x0000000101bd9b58 do_runtime_invoke + 88 (object.c:2860)
21  com.sf.rf                       0x0000000101c1b4da start_wrapper + 538 (threads.c:847)
22  com.sf.rf                       0x0000000101c9cdcd inner_start_thread + 189 (mono-threads.c:1172)
23  libsystem_pthread.dylib         0x000000010ea3593b _pthread_body + 180
24  libsystem_pthread.dylib         0x000000010ea35887 _pthread_start + 286
25  libsystem_pthread.dylib         0x000000010ea3508d thread_start + 13

Any ideas about the reason of this behavior? or how to deal with it?

Thank you.

How to store enums using CrossSettings plugin xam.plugin.settings 3.0.1

$
0
0

The following used to work but now throws an error cannot convert from ConnectionMethod to decimal

public static ConnectionMethod connectionMethod
{
get { return AppSettings.GetValueOrDefault(connMethodKey, connMethodDefault); }
set { AppSettings.AddOrUpdateValue(connMethodKey, value); }
}

I understand I need to serialize the value to and from string but I cannot find an example of this and must confess I can't work it out myself.

Could someone show me an example of how this is done?

Viewing all 204402 articles
Browse latest View live


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