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

Xamarin Prism WebKit Error

$
0
0

Hello,
I'm a newbie at Xamarin. Im' trying to make my first application with prism. I want to create a simple button, but when i compile i have two errors:

error: cannot find symbol
    public void onReceivedError (android.webkit.WebView p0, android.webkit.WebResourceRequest p1, android.webkit.WebResourceError p2)
  symbol:   class WebResourceError
  location: package android.webkit  PrismUnityApp1.Droid    C:\Users\Lalla\documents\visual studio 2015\Projects\PrismUnityApp1\PrismUnityApp1\PrismUnityApp1.Droid\obj\Debug\android\src\md5b60ffeb829f638581ab2bb9b1a7f4f3f\WebViewRenderer_WebClient.java    53


error: cannot find symbol
    private native void n_onReceivedError (android.webkit.WebView p0, android.webkit.WebResourceRequest p1, android.webkit.WebResourceError p2);
  symbol:   class WebResourceError
  location: package android.webkit  PrismUnityApp1.Droid    C:\Users\Lalla\documents\visual studio 2015\Projects\PrismUnityApp1\PrismUnityApp1\PrismUnityApp1.Droid\obj\Debug\android\src\md5b60ffeb829f638581ab2bb9b1a7f4f3f\WebViewRenderer_WebClient.java    58

I can't figure out how to solve this!


Binding TwoWays

$
0
0

I read the documentation of Binding TwoWays, but I did not understand well for that functions , someone could explain briefly?

Xamarin.Forms Intellisense not Working Inside Grid,Stacklayout element

$
0
0

I am Working With Vs 2015 with Update 2, Xamarin 4.2.0.703.Please help me.i am in trouble.i have attached file

How to resolve allocation failed for scaled bitmap exception ?

$
0
0

Hi I m building Xamarin.forms PCL application. In my app there are 35 Carousel page and on each Carousel page there is one video. While playing video I m getting an exception "allocation failed for scaled bitmap". Please help me to resolve this issue ......

[UWP] How can I make the TitleBar always render on top of other Xaml content?

$
0
0

I have an Xamrin forms application the allows the user to drag a background image around the screen. With UWP, the image renders on top of the title bar and obscures it. I'd like the image being dragged to render beneath the title bar so that it does not obscure it.

On iOS and Android, the title bar is never obscured by the image.

See image for behavior I'm trying to prevent (note how image is obscuring title bar).

Here is the relavent Xaml if it helps:


<ContentPage.Content>

    <!--The layout below can be dragged around and it obscures the title bar. How to make it render below the title bar on UWP-->
    <AbsoluteLayout x:Name="EnvironmentCompositionLayout" BackgroundColor="Green" AbsoluteLayout.LayoutBounds="0,0,1,1" AbsoluteLayout.LayoutFlags="All">
      <Grid BackgroundColor="Transparent" AbsoluteLayout.LayoutBounds="0,0,800,800" AbsoluteLayout.LayoutFlags="None">
        <AbsoluteLayout.GestureRecognizers>
          <gesture:PressedGestureRecognizer x:Name="EnvironmentPressedGestureRecognizer"/>
          <gesture:PanScaleRotateGestureRecognizer x:Name="EnvironmentPanScaleRotateGestureRecognizer"/>
        </AbsoluteLayout.GestureRecognizers>
      </Grid>
      <ffimage:CachedImage x:Name="EnvironmentImage" Source="{Binding Photo.ImageName}" Aspect="AspectFit" AbsoluteLayout.LayoutBounds=".5,.5,1,1"
                           AbsoluteLayout.LayoutFlags="All" InputTransparent="true"/>
    </AbsoluteLayout>

  </AbsoluteLayout>
  <Image Source="togglefitfill.png" Margin="20" AbsoluteLayout.LayoutBounds="1,0,90,90" AbsoluteLayout.LayoutFlags="XProportional">
    <Image.GestureRecognizers>
      <TapGestureRecognizer x:Name="ToggleFitFillTapGesture" Tapped="ToggleFitFill" CommandParameter="3" NumberOfTapsRequired="1" />
    </Image.GestureRecognizers>
  </Image>
  <Image x:Name="ToggleLockBackgroundImage" Source="backgroundLocked.png" Margin="20" AbsoluteLayout.LayoutBounds="1,65,90,90" AbsoluteLayout.LayoutFlags="XProportional">
    <Image.GestureRecognizers>
      <TapGestureRecognizer x:Name="ToggleLockBackgroundTapGesture" Tapped="ToggleLockedBackground" CommandParameter="3" NumberOfTapsRequired="1" />
    </Image.GestureRecognizers>
  </Image>
</AbsoluteLayout>

</ContentPage.Content>

Customize Image Source URL path

$
0
0

Hi! This is my first question in the forums and I got to this point because I've found no help anywhere.

The story is as follows:

  • I get an object from web that has an ImageURL property
  • I have an online resizer (imagine something like myresizer.com/image=[ImageURL]&size=[size] that will return a resized image)
  • I have in my Xaml something like: <Image Source="{Binding ImageURL}">

Now, I want to change that source to a string something like "myresizer.com/image="imageurl"&size"300""

I don't know many ways to do this, if you have a better idea, please let me know, but what I thought of the following solution:

  • Having a class (named ImageResized) that inherits from "Xamarin.Forms.Image" and overrides the source url to something like:
    (pseudocde) Source = string.format{"myresizer.com/image=\"{0}\"&size=\"{1}\"", Source, "300");

  • In my xaml I use ImageResized instead of image like this: <local:ImageResized Source="{Binding ImageURL}>"

Once I have that, I guess that adding a new property like the size to my ImageResized wouldn't be much trouble, and if you can help me with that so I can do <local:ImageResized Source="{Binding ImageURL} Size="{Binding ImageSize}>" I will really appreciate!

Thank you in advance for any help!

How do I pass data from one Tabbed Page to another?

$
0
0

Say I have Page1 and Page2 on a Tabbed Page and I select data from a drop down list in Page1. How I get that data into Page 2 of a Tabbed Page?

Only disable controls of selected rows in listview

$
0
0
Hi I have a list view in that view cell I have two button after clicking any of button should disable both button from that row only.any one have any suggestion how to archive this.

Simple Xamarin Form Shared Project not runnigs

$
0
0

I Just create a Xamarin Form Shared Project and guess its not running and gives some errors.
Here is the list of errors i got

Severity    Code    Description Project File    Line    Suppression State
Error       Please install package: 'Xamarin.Android.Support.v7.RecyclerView' available in SDK installer. Java library file C:\Users\Mobin\AppData\Local\Xamarin\Xamarin.Android.Support.v7.RecyclerView\23.3.0.0\content\classes.jar doesn't exist.    App4.Droid
Severity    Code    Description Project File    Line    Suppression State
Error       Please install package: 'Xamarin.Android.Support.v7.RecyclerView' available in SDK installer. Android resource directory C:\Users\Mobin\AppData\Local\Xamarin\Xamarin.Android.Support.v7.RecyclerView\23.3.0.0\content\./ doesn't exist.    App4.Droid
Severity    Code    Description Project File    Line    Suppression State
Error       Please install package: 'Xamarin.Android.Support.v7.MediaRouter' available in SDK installer. Java library file C:\Users\Mobin\AppData\Local\Xamarin\Xamarin.Android.Support.v7.MediaRouter\23.3.0.0\content\libs/internal_impl-23.3.0.jar doesn't exist.    App4.Droid
Severity    Code    Description Project File    Line    Suppression State
Error       Please install package: 'Xamarin.Android.Support.v7.MediaRouter' available in SDK installer. Java library file C:\Users\Mobin\AppData\Local\Xamarin\Xamarin.Android.Support.v7.MediaRouter\23.3.0.0\content\classes.jar doesn't exist.  App4.Droid
Severity    Code    Description Project File    Line    Suppression State
Error       Please install package: 'Xamarin.Android.Support.v7.MediaRouter' available in SDK installer. Android resource directory C:\Users\Mobin\AppData\Local\Xamarin\Xamarin.Android.Support.v7.MediaRouter\23.3.0.0\content\./ doesn't exist.  App4.Droid
Severity    Code    Description Project File    Line    Suppression State
Error       Please install package: 'Xamarin.Android.Support.v7.CardView' available in SDK installer. Java library file C:\Users\Mobin\AppData\Local\Xamarin\Xamarin.Android.Support.v7.CardView\23.3.0.0\content\classes.jar doesn't exist.    App4.Droid
Severity    Code    Description Project File    Line    Suppression State
Error       Please install package: 'Xamarin.Android.Support.v7.CardView' available in SDK installer. Android resource directory C:\Users\Mobin\AppData\Local\Xamarin\Xamarin.Android.Support.v7.CardView\23.3.0.0\content\./ doesn't exist.    App4.Droid
Severity    Code    Description Project File    Line    Suppression State
Error       Please install package: 'Xamarin.Android.Support.v7.AppCompat' available in SDK installer. Java library file C:\Users\Mobin\AppData\Local\Xamarin\Xamarin.Android.Support.v7.AppCompat\23.3.0.0\content\classes.jar doesn't exist.  App4.Droid
Severity    Code    Description Project File    Line    Suppression State
Error       Please install package: 'Xamarin.Android.Support.v7.AppCompat' available in SDK installer. Android resource directory C:\Users\Mobin\AppData\Local\Xamarin\Xamarin.Android.Support.v7.AppCompat\23.3.0.0\content\./ doesn't exist.  App4.Droid
Severity    Code    Description Project File    Line    Suppression State
Error       Please install package: 'Xamarin.Android.Support.v4' available in SDK installer. Java library file C:\Users\Mobin\AppData\Local\Xamarin\Xamarin.Android.Support.v4\23.3.0.0\embedded\libs/internal_impl-23.3.0.jar doesn't exist.   App4.Droid

Some things i point out that my project is
Compile Using android version Android 5.0 (Lollipop)
Minimum and Target Android Version is Use Compile using SDK version
Linking is none
Archietecture is armeabi-v7a

My ALL SKD are installed from 19 to 25.

Then why these errors comes out ?????

Here is my project bitbucket link

https://bitbucket.org/mobinyaqoob/xamarinformshared

https://bitbucket.org/mobinyaqoob/xamarinformshared

Back button closes 'App' but not the rest of the application

$
0
0

When an Android app (at least within a Xamarin.Forms PCL C# project) is closed by the back button and then restarted by the user - a new App class instance is created, but the rest of the app is still running. Static fields in other classes are still set to what they were before.
Is this a bug? If not - how can I avoid a crash when the user restarts the app?

Manually load views in Prism

$
0
0

I have a requirement to create dashboard or widgets in a Prism app. Basically you get a list of widgets based on your security level, you may only have access to x number of modules and within them, these modules can have to level navigation options (implemented) or a widget to present on the dashboard which has it's own viewmodel.

There's no nice way of loading in XAML like you can in WPF and it will have it's parent binding context etc.

I've been looking at different approaches for this, I thought of loading the views into a bindable collection and presenting then via a custom tileview control we have.

I found this post which involves creating your own region manager

http://stackoverflow.com/questions/28652090/xamarin-forms-dynamically-load-content-in-a-page

I was wondering if anyone has attempted this and if they run into memory management issues, as the dashboard is a details page in a masterdetail app it loads in and out of memory so I'd imagine I'd have to handle cleaning up the binding context of the views when the page is destroyed and any behaviors to allow navigation from the widget into modules.

I'm wondering if anyone has attempted something similar in Prism or in Forms in general

I know there's the dynamic forms nuget library but it hasn't been touched in a while and the Forms team don't seem to recommend that approach from what I saw on a Forum post.

Thought I'd ask before I spend a few weeks on it only to find out I've been a bit overambitious with Forms.

Display pdf, image in xamarin forms

$
0
0

Hi,

i need to display the .pdf or .img file based on the user chosen. i have been using the dependency service and below is my code snippet. but i getting the exception as "ActivityNotFoundException: No Activity found to handle Intent".

public SaveAndReadDocuments(string filename)
{
string sourcePath = Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal), "App-Folder");
string destPath = Android.OS.Environment.ExternalStorageDirectory.Path + "/MaterialsReg/";
Directory.CreateDirectory(destPath);
File.Copy(sourcePath + "/" + filename, destPath + "/" + filename, true);

            Java.IO.File file = new Java.IO.File(destPath);
            Intent intent = new Intent(Intent.ActionView);
            intent.SetDataAndType(Android.Net.Uri.FromFile(file), "application/pdf");
            Forms.Context.StartActivity(intent);

}

[PRISM] Navigation in Tabbed Page

$
0
0

In my MainTabbedPage I have this:
https://codepaste.net/gk8u6j

In UsersPage I have a ListView. Thus, when user click on an item, it opens a detail page.
However, when the detail page appears, the tabs (Main, Group and Users) still there in the layout.

I want the same navigation effect of Facebook Messenger App and WhatsApp.
When the detail page (their conversation page) open, it opens over the Tabbed Page.

I've tried without this:
https://codepaste.net/uxgu46

But navigation doesn't work properly. Actually, this way, detail page opens like a modal and not a navigation page.

Any idea?
Thank you.

Compilation errors

$
0
0

Hi,

I am getting couple of compilation errors in xamarin.forms project,

1) The "XamlCTask" task has been declared or used incorrectly, or failed during construction. Check the spelling of the task name and the assembly name.
2) The "XamlCTask" task could not be instantiated from "E:\XamarinPractice\offlinesample\packages\Xamarin.Forms.2.3.3.175\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20\Xamarin.Forms.Build.Tasks.dll".
Could not load file or assembly 'Xamarin.Forms.Build.Tasks, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)

I have updated xamarin forms to latest version.
xamarin.forms.core version : 2.0.0.0
runtime version : v4.0.30319

Can any one help me with this error.

Thanks,
Mahesh

Installed Forms.GoogleMaps and got a System.TypeLoadException

$
0
0

I hava a xamarin forms solution where I try to insert GoogleMaps (using nuget)
https://github.com/amay077/Xamarin.Forms.GoogleMaps

But after I added it I get an exception after the splashscreen has been showed and I Init the Forms.

Exception is
System.TypeLoadException: Could not resolve type with token 0100000e

Got it at this line of droid app
global::Xamarin.Forms.Forms.Init(this, bundle);

Kind of new to xamarin development so I need help finding what causes this exception. I'm guessing there is an error adding some dll or something?


Touch Events in Xamarin.Forms?

$
0
0

Am I crazy or is there no way to get at basic touch events (up/down/move) in Xamarin Forms?

It's trivial to add a custom renderer for a control and then access the touch events in the Android/iOS implementation. Problem is this results in a lot of repeated code if you have multiple types of controls that you need to get touch events for (plus the need for customer renderers that I wouldn't otherwise need).

I tried making a "touch service" that would take in a VisualElement and the platform implementation would wire up all the listeners on that element. The problem is I can't figure out how to get from a VisualElement to a native control so that I can subscribe to touch events. For instance, in my Android implementation I tried RendererFactory.GetRenderer(visualElement).ViewGroup.Touch += (s, e) { /* touch handler code */ }, but that never gets triggered.

Does Application.Current.Properties support persistent storage?

$
0
0

I've seen various bits of information suggesting that Xamarin Forms 1.3 has built-in persistent property storage, however I've not been able to get any formal documentation, examples, or even confirmation that this is true in the first place.

So is that a capability, or not?

Thanks!

iOS 7.X Supported Still?

$
0
0

I have been deploying to a small subset of users that have been clinging to their 7.1.2 devices. I haven't been able to simulate or test recently just due to device availability and also it seems xcode left iOS 7 in the dust in one of my recent upgrades. I just updated the app and seem to have broken 7.1.2 compatibility unfortunately, with no real good way to test it?

How are devs developing for iOS 10 and 7?

Xamarin Forms Previewer Not working only showing blue blank screen

$
0
0

Anybody knows why ? It did not give me any errors; it is just not working.

Please help :)

How to restore the navigation stack after page suspend / resume in Xamarin.Forms

$
0
0

Hey Guys,

I'm just getting used to Xamarin.Forms and cant seem to find a standard way of restoring the navigation stack after a suspend / restore (like when the device gets rotated).

Using either the v1.3.0 release or maybe even xamarin.forms.labs I can capture some restore/suspend events, but I dont understand how I'm meant to restore the navigation stack in my app?

For example, if I have my HomeView and HomeViewModel, which has a list view of items. Somebody clicks the list view item and it navigates to my ItemView and ItemViewModel. Then the user rotates the screen - how do I restore them to where they just were?

Can anyone point me in the right direction?

Thanks

Matt

Viewing all 91519 articles
Browse latest View live


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