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

How do you create a Material MasterDetailPage?

$
0
0

Hi!

I'm creating an app using the MasterDetailPage. I was inspired from Hanselman and have used a bit of his code. Everything is going pretty good, but I have a hard time designing the NavigationDrawer in the MasterDetailPage on Android.

Now it looks like which you can see looks like Android 1.6 with the ugly orange color. It is supposed to look more like this

Is there anyone that has made something like this and can help me?


Swipe to delete functionality for ListView using Xamarin Forms

$
0
0

Hi,

Can anyone suggest me how to implement swipe to delete functionality which is a default functionality for listview in native iOS in xamarin forms for both Android and iOS.

Thanks,
sunil

Akavache loss information on IOS

$
0
0

We are using Akavache on project, in Android everything works great but on iOS we had some issue that is if we save a key value in the cache like this:

public async void Salvar(Login login)
{
    await BlobCache.LocalMachine.InsertObject("login", login);
}

BlobCache will save without erros, if i stop the debug session, and start again the debug and try do get the value using:

    public async Task<Login> Recuperar()
    {
                try
                {
                    var dados = await BlobCache.LocalMachine.GetObject<Login>("login");

                    return dados;
                }
                catch (KeyNotFoundException)
                {
                    return null;
                }
    }

i will get the KeyNotFoundException, i dont know why in Android works great but on iOS seeams that the database is gone after restart the app.

in my Xamarin config on Visual Studio check Preserve application data/cache on device between deploys is true and my

BlobCache.ApplicationName = "AppName";
at OnStar Method

Anyone knows what is happening? thanks

Showing empty view when ListView is empty in Xamarin.Forms

$
0
0

Is there a way to replicate this in forms?I want to show a message like "empty list" when listveiw is empty.

Entry/Editor text binding issue on ios when spellchecker autocorrect text

$
0
0

I found a possible bug on Entryand Editorcontrols on ios (XF v2.3.2.127). Try to enter some text with typo and then tap on "close" button on keyboard or just tap on another page content for hiding keyboard. In this case last value in view model which is binded to Textcontrol property is the text with typo, but you can see autocorrected text in control. DON'T tap on suggested word because in this case binding works fine.
On android everything works fine.
Can someone confirm this bug or describe this behavior?``

Client flow for authorizations against Azure App Service

$
0
0

Hi all,

right now I have a working forms project in IOS and Android using Azure APP service with authentication based on the so called service flow, the one where the login is presented in a web view by the mobile service SDK. I need to change this to use the so called client flow. can any one point me at a working example of this in side forms on both IOS and android. I need to support live and google accounts.

Navigate to MasterDetailPage from other Page

$
0
0

In my app, some pages are different for mobile and tablet. For tablet I put two pages in one using MasterDetailPage and this one is called through navigation because I need the back button to return to menu page.
For IOS the layout is perfect, but for android I get a blank space bettween navigation bar and MasterDetailPage content.
How can I take off this space? I need some help, I've tried everything I could.

How to display SVG image in Xamarin Forms project.

$
0
0

Hi Frineds,

I am very new in Xamarin and Xamarin Form as well. Can anybody tell me how to display Image with SVG format in Xamarin Forms? If code snippet provide, then it is really helpful.

Thanks,
Prashant N


getting a constructor to wait for a method to finish run before proceeding

$
0
0

I have a method that connects to a database
public EventsList() {
var response =AmazonUtils.DynamoDBClient.ScanAsync("Event", attributesToGet, new System.Threading.CancellationToken()).ContinueWith((Task<Amazon.DynamoDBv2.Model.ScanResponse> arg) =>
{

          var results =  arg.Result;

          foreach (Dictionary<string, AttributeValue> item in results.Items)
          {
           //the processitem method takes the attributename and value and just adds a new item to the array of items

           ProcessItem(item);

          }


         });

// events is an array of items which is global

this.Items = events

}

but the the issue is the constructor wont wait for the results
and items will be null for that page

since i cant have an async constructor im lost to what should i do. all the other examples show only to load one item which is not what i need
i need to load 4 - 6 items
but i cant do that cause the constructor will finish and the items wont load into my page cause of it
i am getting data cause the processitem spits the data out to the console but it loads after the page loads

im trying every thing and still coming up short i had it working before with a listview.itemsource property but i cant change the orientation cause my ui needs to go horizontal
i thought writing a custom render would allow me to change the orientation but that didnt work

Can we place SearchBar in the navigation bar

$
0
0

Hi,

Can we place SearchBar in the navigation bar (like toolbar item)?

Thanks,
Aratrika

After enabling MultiDex, Android app crashes after deployment

$
0
0

Our project has expanded to include libraries with a method count >= 64k so we have had to enable MultiDex.
Since enabling it, my app is crashing immediately upon deployment to my android emulator.

I've searched the web and the only solution I have found is to uninstall all of the xamarin.android and mono runtimes on the device, which I have done. This did not solve it.

Note: my project is Xamarin.Forms with a portable project

My device log shows the following output with errors after the app crashes.

this line in particular indicates to me that the MultiDex option caused some issue:

java.lang.RuntimeException: Unable to instantiate application md5ca27074e405277e6c40e6a6588077a84.MainApplication: java.lang.ClassNotFoundException: Didn't find class "md5ca27074e405277e6c40e6a6588077a84.MainApplication" on path: DexPathList[[zip file "/data/app/com.cii.patrollive-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.cii.patrollive-1, /system/lib]]

Full device log output:

01-10 08:38:44.593 5" KitKat (4.4) XXHDPI Phone Error 1966 memtrack Couldn't load memtrack module (No such file or directory)
01-10 08:38:44.593 5" KitKat (4.4) XXHDPI Phone Error 1966 android.os.Debug failed to load memtrack module: -2
01-10 08:38:44.565 5" KitKat (4.4) XXHDPI Phone Error 1966 cutils-trace Error opening trace file: No such file or directory (2)
01-10 08:38:39.201 5" KitKat (4.4) XXHDPI Phone Error 1948 AndroidRuntime at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
01-10 08:38:39.201 5" KitKat (4.4) XXHDPI Phone Error 1948 AndroidRuntime at android.app.ActivityThread.main(ActivityThread.java:5001)
01-10 08:38:39.201 5" KitKat (4.4) XXHDPI Phone Error 1948 AndroidRuntime at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
01-10 08:38:39.201 5" KitKat (4.4) XXHDPI Phone Error 1948 AndroidRuntime at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
01-10 08:38:39.201 5" KitKat (4.4) XXHDPI Phone Error 1948 AndroidRuntime Caused by: java.lang.ClassNotFoundException: Didn't find class "md5ca27074e405277e6c40e6a6588077a84.MainApplication" on path: DexPathList[[zip file "/data/app/com.cii.patrollive-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.cii.patrollive-1, /system/lib]]
01-10 08:38:39.201 5" KitKat (4.4) XXHDPI Phone Error 1948 AndroidRuntime at android.os.Looper.loop(Looper.java:136)
01-10 08:38:39.201 5" KitKat (4.4) XXHDPI Phone Error 1948 AndroidRuntime ... 11 more
01-10 08:38:39.201 5" KitKat (4.4) XXHDPI Phone Error 1948 AndroidRuntime at android.app.ActivityThread.access$1500(ActivityThread.java:135)
01-10 08:38:39.201 5" KitKat (4.4) XXHDPI Phone Error 1948 AndroidRuntime at android.app.LoadedApk.makeApplication(LoadedApk.java:507)
01-10 08:38:39.201 5" KitKat (4.4) XXHDPI Phone Error 1948 AndroidRuntime at java.lang.reflect.Method.invoke(Method.java:515)
01-10 08:38:39.201 5" KitKat (4.4) XXHDPI Phone Error 1948 AndroidRuntime at android.os.Handler.dispatchMessage(Handler.java:102)
01-10 08:38:39.201 5" KitKat (4.4) XXHDPI Phone Error 1948 AndroidRuntime at android.app.Instrumentation.newApplication(Instrumentation.java:975)
01-10 08:38:39.201 5" KitKat (4.4) XXHDPI Phone Error 1948 AndroidRuntime Process: com.cii.patrollive, PID: 1948
01-10 08:38:39.201 5" KitKat (4.4) XXHDPI Phone Error 1948 AndroidRuntime at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
01-10 08:38:39.201 5" KitKat (4.4) XXHDPI Phone Error 1948 AndroidRuntime at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4301)
01-10 08:38:39.201 5" KitKat (4.4) XXHDPI Phone Error 1948 AndroidRuntime java.lang.RuntimeException: Unable to instantiate application md5ca27074e405277e6c40e6a6588077a84.MainApplication: java.lang.ClassNotFoundException: Didn't find class "md5ca27074e405277e6c40e6a6588077a84.MainApplication" on path: DexPathList[[zip file "/data/app/com.cii.patrollive-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.cii.patrollive-1, /system/lib]]
01-10 08:38:39.201 5" KitKat (4.4) XXHDPI Phone Error 1948 AndroidRuntime at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
01-10 08:38:39.201 5" KitKat (4.4) XXHDPI Phone Error 1948 AndroidRuntime at java.lang.reflect.Method.invokeNative(Native Method)
01-10 08:38:39.201 5" KitKat (4.4) XXHDPI Phone Error 1948 AndroidRuntime FATAL EXCEPTION: main
01-10 08:38:39.201 5" KitKat (4.4) XXHDPI Phone Error 1948 AndroidRuntime at dalvik.system.NativeStart.main(Native Method)
01-10 08:38:39.201 5" KitKat (4.4) XXHDPI Phone Error 1948 AndroidRuntime at android.app.LoadedApk.makeApplication(LoadedApk.java:502)
01-10 08:38:39.201 5" KitKat (4.4) XXHDPI Phone Error 1948 AndroidRuntime at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
01-10 08:38:38.917 5" KitKat (4.4) XXHDPI Phone Error 1938 memtrack Couldn't load memtrack module (No such file or directory)
01-10 08:38:38.917 5" KitKat (4.4) XXHDPI Phone Error 1938 android.os.Debug failed to load memtrack module: -2
01-10 08:38:38.845 5" KitKat (4.4) XXHDPI Phone Error 1938 cutils-trace Error opening trace file: No such file or directory (2)
01-10 08:38:38.541 5" KitKat (4.4) XXHDPI Phone Error 1926 cutils-trace Error opening trace file: No such file or directory (2)
01-10 08:38:38.469 5" KitKat (4.4) XXHDPI Phone Error 1926 memtrack Couldn't load memtrack module (No such file or directory)
01-10 08:38:38.469 5" KitKat (4.4) XXHDPI Phone Error 1926 android.os.Debug failed to load memtrack module: -2
01-10 08:38:34.757 5" KitKat (4.4) XXHDPI Phone Error 1896 android.os.Debug failed to load memtrack module: -2
01-10 08:38:34.757 5" KitKat (4.4) XXHDPI Phone Error 1896 memtrack Couldn't load memtrack module (No such file or directory)
01-10 08:38:34.729 5" KitKat (4.4) XXHDPI Phone Error 1896 cutils-trace Error opening trace file: No such file or directory (2)
01-10 08:38:34.445 5" KitKat (4.4) XXHDPI Phone Error 1880 android.os.Debug failed to load memtrack module: -2
01-10 08:38:34.445 5" KitKat (4.4) XXHDPI Phone Error 1880 memtrack Couldn't load memtrack module (No such file or directory)
01-10 08:38:34.421 5" KitKat (4.4) XXHDPI Phone Error 1880 cutils-trace Error opening trace file: No such file or directory (2)
01-10 08:38:34.145 5" KitKat (4.4) XXHDPI Phone Error 1866 android.os.Debug failed to load memtrack module: -2
01-10 08:38:34.145 5" KitKat (4.4) XXHDPI Phone Error 1866 memtrack Couldn't load memtrack module (No such file or directory)
01-10 08:38:34.113 5" KitKat (4.4) XXHDPI Phone Error 1866 cutils-trace Error opening trace file: No such file or directory (2)

Do timed local notifications work on UWP using the LocalNotifications plugin?

$
0
0

@JamesMontemagno

Does anybody see timed local notifications working on UWP using the LocalNotifications plugin? I see untimed ones, but not timed. Trying to work out if I've missed some weird bit of config, but as the untimed ones work, I'm dubious about that.

Why UWP Images in Root Rather Than Assets?

$
0
0

To use the same local image across iOS, Android and Windows in Xamarin Forms -- AND use the same file name -- you need to follow Xamarin's conventions for where to locate the file. For iOS, the image file goes into the Resources folder. For Android, the image file goes into the Resources/drawable* folder(s). But for UWP, the image goes into the root directory. Why not the Assets directory? This is the more traditional location. What am I missing?

Xamarin.Forms 2.3.4.184-pre1

$
0
0

We've pushed Xamarin.Forms 2.3.4.184-pre1 to nuget. To install the pre-release, check the pre-release option in your nuget manager and install this version.

If you’ve got a bug to report, drop us a quick report here so we can troubleshoot in detail.

Important notes

  • Xamarin.Forms 2.3.4 depends on a Xamarin installation of Cycle 9. Users upgrading from Xamarin.Forms 2.3.3 (or earlier) will experience numerous compile errors if they attempt to build without first upgrading their Xamarin installation.

  • When upgrading Xamarin.Forms, take care not to simply "update all" as that will update the Xamarin.Android.Support packages to an incompatible version. More info here.

2.3.4.184-pre1

For all the details, please read the release post here. There is SO much goodness in this release, it's actually too long for the forum.

How to load files using assemblies without adding references in Xamarin.Forms with Prism Modules.

$
0
0

I'm very newbie to Prism Modules, I have a question i.e, I'm currently working on Xamarin.Forms using Prism Modules. Is there anyway to add the modules into the module catalog without adding the references of the Prism Modules. If yes, please suggest me on how to use. Currently, I'm checking with assemblies and reflections but, couldn't make it.

Thank you.


Editor field brings up a picker like selection list.

$
0
0

Hello All.

I have a simple Xamarin Forms page with a grid which has a number of rows, a couple of rows have picker fields, one has an entry field and one has an editor field.

When I run the app in IOS and tap into the editor field an empty picker stye list appears at the bottom of the screen, it has the Done option on the right hand side but does not have any options to select. For an editor field I just want the user to be able to type text in and don't want this picker-style list to appear on the screen, can anybody tell me why it appears and, more importantly, how I can stop it appearing ?

I see it appears on some IOS screenshots on Xamarin's website (please see the IOS example in the Editor manual page https://developer.xamarin.com/guides/xamarin-forms/user-interface/text/editor/) so maybe this is expected behaviour but is there an option to stop it appearing ?

When I tap in either of the picker fields the related list of options appears at the bottom of the screen as expected.

The xaml for the editor on my page is very basic:

<Editor Grid.Row="17" Grid.Column="1" x:Name="tComments" Text="{Binding JobComments}" />

Thank you, all help is appreciated.

Packages Folder missing in Solution outline

$
0
0

The Packages folder is missing from the Solution outline in my Shared project. Therefore, I can't add any packages or update any packages in my Shared project.

Appearance in the iOS part of a Xamarin.Forms app

$
0
0

I'm trying to set the styling of an iOS app built in Xamarin.Forms. I would like to test out iOS styling. I have the code below. My button has a green background, but I can't get the text color of the buttons to be red. I'm just trying to test out if this work, and it doesn't seem to inspite of

https://developer.xamarin.com/guides/xamarin-forms/platform-features/ios/theme/#uiappearance

    public override bool FinishedLaunching(UIApplication app, NSDictionary options)
    {
    UIButton.Appearance.BackgroundColor = UIColor.Green;
    UIButton.Appearance.TintColor = UIColor.Red;
    UIButton.Appearance.SetTitleColor(UIColor.Red, UIControlState.Normal);

        global::Xamarin.Forms.Forms.Init();
        LoadApplication(new App());
    return base.FinishedLaunching(app, options);
    }

Any ideas on this are appreciated. Thanks!

How to get the ViewModel to communicate to the View's code behind file.

$
0
0

I am wondering if someone can point me to best practices of communicating from the ViewModel to the view's code behind. I would guess events/messaging etc but would like some input on it. There are UI changes I would prefer to keep out of the XAML file (for some reason I find XAML files with lots of markup for logic ummm, 'smelly'?). But I'm trying to be a good MVVM boy so I don't want it in ViewModel. Any pointers or examples out there you know about would be appreciated.

How to implement Expandable/Collapsible ListView in xamarin forms?

$
0
0

Can anyone help me to implement Expandable/Collapsible ListView in xamarin forms. I have attached a screenshot as an example.

Viewing all 91519 articles
Browse latest View live


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