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

Xamarin Forms Marshmallow Permissions

$
0
0

Hi,
I am trying to ask for location permission on Android 6 through the DependencyService. My problem is that I do not know how to handle the callback of the ActivityCompat.RequestPermissions (activity, permissionGroup, permissionRequestID);

I tried to follow this and this but since I do not have a class for the activity I can not use OnRequestPermissionsResult. A solution I tried was to extend the activity object at runtime but using ActivityCompat.IOnRequestPermissionsResultCallback says there is no override for OnRequestPermissionsResult


Deselect selected item of ListView

$
0
0

Hi, I want to deselect already selected item by click. So the user first clicks an item and it becomes selected, then user clicks same item once again and it should become deselected. Following code doesn't work, the item is still shown as selected, however Selected property of ListView is null.

list.ItemTapped += (sender, e) => {
    if(e.Item == null) return;

    if(selectedItem == e.Item)
    {
        ((ListView)sender).SelectedItem = null;

        selectedItem = null;
    }
    else{
        selectedItem = e.Item;
    }
}; 

can't run the default app

$
0
0

i try to semulate the default app in visual studio but i get this errors

Add load-more button at the end of Listview

Xamarin form 2.3 caused Tabbedpage icon size shrink

$
0
0

I have just upgraded to the newest XF and noticed all my icons shrinked in size . It seems like there's huge padding added . Anyone have solution ?

My codes for the icons

this.Children.Add (new NavigationPage(new HomePage()){Icon ="icon_home.png" } );
this.Children.Add (new AboutPage(){Icon ="icon_about.png"});
this.Children.Add (new EligibilityPage(){Icon ="icon_ec.png"});
this.Children.Add (new FaqPage(){Icon ="icon_faq.png"});
this.Children.Add (new ContactPage(){Icon ="icon_contact.png"});

Compiling Error: Xamarin.iOS.Common.targets

$
0
0

Xamarin Studio 6.0(build 5174)

From Errors:

/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets: Error: Error executing task ReadItemsFromFile: Name cannot begin with the '<' character, hexadecimal value 0x3C. Line 3, position 2.

From LogFile:

Target _ReadCoreCompileInterfaceDefinitions:
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets: error : Error executing task ReadItemsFromFile: Name cannot begin with the '<' character, hexadecimal value 0x3C. Line 3, position 2.
Build FAILED.
Errors:

    /Users/simplesolutionsMAC/Documents/Projectos/JunaNote/iOS/JunaNote.iOS.csproj (Build) ->

/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets (_ReadCoreCompileInterfaceDefinitions target) ->

        /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets: error : Error executing task ReadItemsFromFile: Name cannot begin with the '<' character, hexadecimal value 0x3C. Line 3, position 2.

         0 Warning(s)
         1 Error(s)

    Time Elapsed 00:00:00.2195200

XamlCTask could not be instantiated

$
0
0

Hi all, I am new to Xamarin forms and have developed a very basic application, which makes use of Azure DB. But on running the app downloaded from the azure portal, i get these errors - 1. XamlCTask couldn't be instantiated. 2. XamlCTask has been declared or used incorrectly. I tried cleaning the solution and rebuilding it, but that didn't work.



<PropertyGroup>
    <PrepareResourcesDependsOn>
        XamlG;
        $(PrepareResourcesDependsOn);
    </PrepareResourcesDependsOn>
</PropertyGroup>

<PropertyGroup>
    <CompileDependsOn>
        $(CompileDependsOn);
        XamlC;
    </CompileDependsOn>
</PropertyGroup>

<Target Name="UpdateDesignTimeXaml" Condition="'$(UseHostCompilerIfAvailable)' == 'true'" DependsOnTargets="PrepareResources; Compile"/>

<Target Name="XamlG" DependsOnTargets="$(XamlGDependsOn)"/>

<PropertyGroup>
    <XamlGDependsOn>
        _PreXamlG;
        _CollectXamlFiles;
        _CoreXamlG;
    </XamlGDependsOn>
</PropertyGroup>

<Target Name="_PreXamlG">
    <MakeDir Directories="$(IntermediateOutputPath)"/>
</Target>

<Target Name="_CollectXamlFiles">
    <ItemGroup>
        <_XamlResources Include="@(EmbeddedResource)" Condition="'%(Extension)' == '.xaml' AND '$(DefaultLanguageSourceExtension)' == '.cs'"/>
    </ItemGroup>
    <FixedCreateCSharpManifestResourceName ResourceFiles="@(_XamlResources)" RootNamespace="$(RootNamespace)">
        <Output TaskParameter="ResourceFilesWithManifestResourceNames" ItemName="XamlFiles" />
    </FixedCreateCSharpManifestResourceName>
    <ItemGroup>
        <XamlGFiles Include="@(XamlFiles->'$(IntermediateOutputPath)%(ManifestResourceName).g$(DefaultLanguageSourceExtension)')"/>
        <Compile Include="@(XamlGFiles)"/>
        <FileWrites Include="@(XamlGFiles)"/>
    </ItemGroup>
</Target>

<Target Name="_CoreXamlG"
    Inputs = "@(XamlFiles)"
    Outputs = "$(IntermediateOutputPath)%(ManifestResourceName).g$(DefaultLanguageSourceExtension)">
    <XamlGTask
        Source="@(XamlFiles)"
        Language = "$(Language)"
        AssemblyName = "$(AssemblyName)"
        OutputFile = "$(IntermediateOutputPath)%(ManifestResourceName).g$(DefaultLanguageSourceExtension)">
    </XamlGTask>
</Target>

<Target Name="XamlC">
    <XamlCTask
        Assembly = "$(IntermediateOutputPath)$(TargetFileName)"
        ReferencePath = "@(ReferencePath)"
        Verbosity = "2"
        OptimizeIL = "true"
        DebugSymbols = "$(DebugSymbols)" />
</Target>

Also attached is a screenshot of the error I am encountering.

SQLite - How to add an object in my base

$
0
0

Hello !
I'm working on an app that use Sqlite Database, and i try to insert objects in my database.
Here's my code :

My ViewModel :

public TestPageViewModel()
    {
        CommandeAjouterEleveur = new RelayCommand(() =>  AjouterEleveurAsync());
        CommandeObtenirLesEleveurs = new RelayCommand(async () => await getLesEleveurs());
    }

    public void AjouterEleveurAsync()
    {
        Eleveur = BusinessServices.EleveurService.CreateObject();
        Eleveur.NomEleveur = "Roger Dupond";
        Eleveur.NomCabinetVeterinaire = "Veterinaire Ouest";
        Eleveur.MoisDebutAnneeComptable = 6;
        Eleveur.ObjectifSevrage = 10;
        Eleveur.ObjectifAbbatus = 12;
        Eleveur.ObjectifPoidMoyen = 225.3;
        Eleveur.ObjectifGMQ = 51;
        Eleveur.ObjectifIC = 23.2;
        Eleveur.NombrePorceletsSevresEnCours = 4;
        Eleveur.PoidsTotalAbattuEnCours = 125.4;
        Eleveur.GUID = Guid.NewGuid();
        Eleveur.ID = 1;
        Eleveur.LastUpdateDate = DateTime.Today;
        LesEleveurs.Add(Eleveur);
    }

My BusinessServices :

public static IEleveurService EleveurService
    {
        get { return SimpleIoc.Default.GetInstance<IEleveurService>(); }
    }

And i get the following error :

"Object refrence not set to an instance of an object"

Anyone know where does it come from ?
Thanks !


any plane to make Xamarin.Forms XAML work with blend ?

$
0
0

is there any plane to make Xamarin.Forms XAML work with blend ?

this way ,designers have unified GUI tool to develop cross-platform , I'm creating an interactive animation apps for kids , the only reason we are using Animate CC with createJs insted of Xamarin is that our animates and designer could not find a unified graphical tool .
of course that course me a lot of heir-tearing cause i had to work with javascript :( instead of C#

regards

ListView - Layout Cycle Detected

$
0
0

Hi,

I have a problem regarding a listview. I'm adding dynamically controls to that listview with a Templateselector. Each added control is a viewcell within different controls (labels, entries, checkboxes,...). I implemented a feature where I can change the controls on the page dynamically. Sometimes I get an Layout Cycle Detected Exception and I do not know how to avoid.
While googeling I found several posts regarding that issue, starting from entering MinimumHeightRequests for included StackLayouts over to adding Heights to the ViewCells. But as I do not have the exact height of a ViewCell, this might not be the appropriate way. Does anyone has an idea how to solve such kinds of problems? I do not have such problems on iOS by the way. Would it also be a possibility to change design from listview to TableView?
Any suggestion would be helpful. Thanks in advance for that.
Jérôme

WebView not appears on complete page in Xamarin Forms.

$
0
0

I used below simple code to execute WebView in Xamarin Forms. It looks good on iOS devices but in case of Android there is gray bar at top and bottom side. I am not getting its reason and so I am not able to solve it. When I used same url on native android for WebView, its also look good that website appears on complete page.

public MyWebPage ()
        {
            var browser = new WebView();

            browser.Source = "http://m.ugoparty.com/";

//          browser.VerticalOptions = LayoutOptions.Fill;
//          browser.HorizontalOptions = LayoutOptions.FillAndExpand;
            Content = browser;
        }

Thanks.

Xlabs.controls.BindableRadioGroup, Horizontal orientation issue in IOS project

$
0
0

Dear,

I'm using the BindableRadioGroup (xlabs controls) and want to use the Horizontal Orientation.
I used as Orientation="Horizontal". Its working in android project. But in IOS, the text is move down and cannot change the spacing between the label and radio button image.

help me out fro this issue.
thanks.

How to change XLabs RadioButton Color ?

$
0
0

Hi I am using XLabs RadioButton in my application.

And I want to change my RadioButton Color because in my iOS application functionally it is okay but I cant see that because my background and radioButton is both of them black.

What should I do if I want Red RadioButton ?

Xamarin Datapages - Getting XamlParseException

$
0
0

I started playing a bit with DataPages.

I followed the instructions from this page, and everything compiled, but when I started the application I got a XamlParseException upon instanciateing the datapage (new SessionDataPage();) :

Position 7:15. No Property of name StyleClass found

I'm aware that Datapages are still in the preview channel, but still - this should work.


Additional Information:

Xaml:

<?xml version="1.0" encoding="utf-8" ?>

<p:ListDataPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:p="clr-namespace:Xamarin.Forms.Pages;assembly=Xamarin.Forms.Pages"
             x:Class="HoloTour.Pages.SessionDataPage"
              StyleClass="Events" Title="Sessions" >

  <p:ListDataPage.DataSource>
    <p:JsonDataSource Source="http://demo3143189.mockable.io/sessions" />
  </p:ListDataPage.DataSource>

</p:ListDataPage>

enter image description here

StackTrace:

  at Xamarin.Forms.Xaml.ApplyPropertiesVisitor.SetPropertyValue(Object xamlelement, XmlName propertyName, Object value, BindableObject rootElement, INode node, HydratationContext context, IXmlLineInfo lineInfo)

at Xamarin.Forms.Xaml.ApplyPropertiesVisitor.Visit(ValueNode node, INode parentNode)
at Xamarin.Forms.Xaml.ValueNode.Accept(IXamlNodeVisitor visitor, INode parentNode)
at Xamarin.Forms.Xaml.RootNode.Accept(IXamlNodeVisitor visitor, INode parentNode)
at Xamarin.Forms.Xaml.XamlLoader.Load(BindableObject view, String xaml)
at Xamarin.Forms.Xaml.XamlLoader.Load(BindableObject view, Type callingType)
at Xamarin.Forms.Xaml.Extensions.LoadFromXaml[TView](TView view, Type callingType)
at HoloTour.Pages.SessionDataPage.InitializeComponent()
at HoloTour.Pages.SessionDataPage..ctor()
at HoloTour.App..ctor()
at HoloTour.UWP.MainPage..ctor()
at HoloTour.UWP.HoloTour_UWP_XamlTypeInfo.XamlTypeInfoProvider.Activate_4_MainPage()
at HoloTour.UWP.HoloTour_UWP_XamlTypeInfo.XamlUserType.ActivateInstance()

ScrollView position gets reset after hide (iOS)

$
0
0

Whenever I hide a scrollview in iOS its position return back to 0 after I hide and show it again, does anyone know any workaround for this? I don't want to save and restore the scroll position each time programmatically because then the user would see the scrollview initial positions first and then its real position and its very nasty.
it doesn't matter whether it is vertical or horizontal, or whether you hide its parent or the scrollview itself.


Xamarin.forms Frame OutlineColor doesn't work on Android

$
0
0

Hey,

I am trying to have a frame which has a border around it and by setting the OutlineColor is does show up on iOS+WP but it doesn't on Android. I have been googling alittle and the issue gets changed to resolved even though it still persists.

Does anyone know a quick fix, since I need this border to complete my project.

Sincerely,

Luuk

I can't build any Android project!!!

$
0
0

For weeks I'm trying to build the Android project with no success!
I got any type of erros, such as:

  • Error CS0117 'Resource.String' does not contain a definition for 'status_bar_notification_info_overflow' (ALL resources are missing)
  • Error "aapt.exe" exited with code - ***** (The code always varies)
  • Please download https://dl-ssl.google.com/android/repository/android_m2repository_r29.zip and extract it to the /Users/MyUser/.local/share/Xamarin/Android.Support.v4/23.3.0.0/content directory. (I got this error to any folders on this directory)
  • Severity Code Description Project File Line Suppression State
    Error The file "obj\Debug\android\bin\packaged_resources" does not exist.

And others.
I try to build:

  • On Xamarin Studio on a Mac.
  • On Visual Studio inside the Parallels Desktop, on a Mac.
  • On Visual Studio in Windows.
    3 different machines!!!

My Xamarin on mac and windows are updated.
My VS is Community 2015.
I install ALL the items, for all version, on Android SDK Manager above the 5.1 Lollipop.
I try to set up the target version.

Even I create a new project, and build without any changes, with that message "Welcome to Xamarin Forms!", I got the same erros!!

Why does a Frame shrink the size of an Image?

$
0
0

Hi,

I have a problem that I so far cannot solve. I have an image. When I display this in XAML using just the <Image> tag, it appears at the intended size. However, when I embed it in a <Frame> tag, it shrinks so small I can hardly see it. No combination of LayoutOptions on either the Image or the Frame seems to fix it. Does anyone know how to fix this?

Any help would be very much appreciated.

This code shows the same image in the two situations I mention above:

    <Frame BackgroundColor="Maroon" HorizontalOptions="Fill" VerticalOptions="Fill">
        <Frame.Behaviors>
            <animate:VisualOpacityBehaviour/>
        </Frame.Behaviors>
        <Image Source="right_arrow.png" HorizontalOptions="CenterAndExpand" VerticalOptions="CenterAndExpand"/>
    </Frame>
    <Image Source="right_arrow.png" HorizontalOptions="EndAndExpand" VerticalOptions="CenterAndExpand"/>

Kind wishes ~ Patrick

Android deployments to physical devices failing on new Win10 rig

$
0
0

So I’m switching to a new Windows 10 platform and moving all my dev resources over – my Forms application builds and runs on iOS, UWP and in the Android emulators – however it won’t deploy to either of my two physical Android devices which both work find if I flip over to my older 8.1 rig. The USB/ADB connection is working on both, both devices come up in the VS drop down for Android and the build goes through but the deployment to both throws this error:

1>:Deployment failed
1>Mono.AndroidTools.InstallFailedException: Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE]
1> at Mono.AndroidTools.Internal.AdbOutputParsing.CheckInstallSuccess(String output, String packageName)
1> at Mono.AndroidTools.AndroidDevice.<>c__DisplayClass90_0.b__0(Task

1 t)
1>   at System.Threading.Tasks.ContinuationTaskFromResultTask
1.InnerInvoke()
1> at System.Threading.Tasks.Task.Execute()
1>The "InstallPackageAssemblies" task failed unexpectedly.

I’ve tried updating the Android SDK/ADB via the SDK monitor – I’m running elevated (as you seem to have to do with everything in Win10) – I’m not sure what else to look for here – something silly I’m missing?

How to change color of Title in TableView for Windows Phone

$
0
0

Hi @all,
how can I change the color of the title in the TableRoot Element of the TableView (and beside that also the color of the Title of TableSection). I found several entries in forums about hiding the TableSection Title when using Android, but is there a common possibility to do that for Windows Phone?

Thanks for your help in advance
Jérôme

Viewing all 81910 articles
Browse latest View live


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