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

Customize Picker in iOS - Entry with down arrow icon

$
0
0

Hi,

I want to customize Picker, It should be display as Entry with down arrow icon(find attchment).
I have done with Android but I didn't get any option for iOS.

Please suggest.

Thanks,
Pramod.


Geting the value of a Picker in Xamarin Forms

$
0
0

How can i get the value of any Picker, is there any property like .Value or .selectedValue? or how can i achieve this in xamarin forms? or do i have to binding an object with BindingContext and get the index of the value and convert it to a string object?

Xamarin PCL showing HTML from MySQL data into a label or page

$
0
0

How can I put a HTML coded data in to a label or something else? I am using the PCL of Xamarin.

Writing in a HTML code:

This is a test link

But be on the page.

Android build failing on Mac, works fine on PC

$
0
0

I have an Android/iOS app that was running on XF 2.3.4.224 for a number of months. This past weekend I updated to 2.4.0.280 and consolidated all the System.* packages to their latest versions. On my PC with Visual Studio 2015, the iOS and Android builds complete successfully. However, when I try to build the same code on Xamarin Studio on the Mac, iOS builds fine but Android fails with this error:

/Users/me/Downloads/Client.Smorgasbord/packages/Xamarin.Forms.2.4.0.280/build/netstandard1.0/Xamarin.Forms.targets: error : Error executing task XamlCTask: No symbol found for file: /Users/me/Downloads/Client.Smorgasbord/Smorgasbord.Mobile.Droid/obj/Release/Smorgasbord.Mobile.Droid.dll

This is a big problem because our CI/CD process uses a MacInCloud VSTS Agent, so I can't generate a formal Android build due to this error.

I've come across a variety of online articles about "Error executing task XamlCTask" errors, most of which refer to "No symbol found" error messages looking for MDB files, but I can't find any solution to the error message I'm facing. Anyone out there have any suggestions?

I'm attaching the Android project build outputs from my PC, Mac and VSTS if that helps.

FYI - I haven't upgraded to the very latest Xamarin.Forms NuGet because our team likes to lag behind a few weeks to let the community shake out the bugs :wink:

Xamarin forms Compile App for ChromeBook ChromeOS

$
0
0

Hello Team,

Regarding my issue. I am using Google Chrome OS version 56.0.2924.110 Platform 9000.910 Firmware Google_Veyron_minnie.6588.237.0 The Google Chrome Book is touch screen. Made by Asus.

Any application I compile in Xamarin Forms PCL, does not run on my Google ChromeBook (Google-Chrome-OS).

I would like to know If anyone had any success in writing and compiling applications that successfully run on Google Chrome OS, using Xamarin Forms. If so, what type of settings did you use while building the application. I cant seem to find anything regarding this in google search. I greatly appreciate any feedback input thoughts on how to compile for Chrome OS.

P.S I have compiled pure native Java Application using Android Studio, and this runs fine on Google Chrome OS. But using Xamarin Forms PCL does not run on Google Chrome OS.

Thank you!

Could not load assembly 'AppName, Version=0.0.0.0, Culture=neutral, PublicKeyToken='. Perhaps it doe

$
0
0

Hi, after build I am getting this error:

Could not load assembly 'AppName, Version=0.0.0.0, Culture=neutral, PublicKeyToken='. Perhaps it doesn't exist in the Mono for Android profile?

Can't run app because of it.
And I am using Multi-Dex.

Do you have any solutions ?

Thanks for answers !!!

Is it possible to have a ListView inside a TableView?

$
0
0

I managed to add a ListView inside a ViewCell in a TableView.
However, the ListView always has the height of a regular ViewCell, and if I have more than one item in the list, they are hidden.

Setting the ViewCell Height property to a fixed value sucks...

I am binding the ListView ItemSource property, and would like to avoid adding elements programmatically from the code behind.

<TableView Intent="Form"
           HasUnevenRows="True">
    <TableView.Root>
        <!--Contacts-->
        <TableSection Title="{Binding Source={x:Static local:DialogMessage.FormConsignorSectionContacts}}">

            <ViewCell>
                <ViewCell.View>
                    <ListView ItemsSource="{Binding Contacts}" BackgroundColor="Red"
                              SelectedItem="{Binding SelectedContactItem, Mode=TwoWay}">

                        <ListView.Behaviors>
                            <behaviors:EventToCommandBehavior EventName="ItemTapped"
                                      Command="{Binding ContactTappedCommand}"
                                      EventArgsConverter="{StaticResource itemTappedEventArgsConverter}"></behaviors:EventToCommandBehavior>
                        </ListView.Behaviors>

                        <ListView.ItemTemplate>
                            <DataTemplate>
                                <TextCell Text="{Binding FullName}"
                                          TextColor="{StaticResource textPrimaryColor}"></TextCell>
                            </DataTemplate>
                        </ListView.ItemTemplate>

                    </ListView>
                </ViewCell.View>
            </ViewCell

        </TableSection>

    </TableView.Root>
</TableView>

Is it possible to use DataTemplates to load views by viewmodel?

$
0
0

Hi I'm new to Xamarin Forms although have some experience with MVVMLight on WPF.

I'm porting an existing WPF application to Xamarin.Forms, and have hit my first (no doubt of many) problem with my Shell View.

In my existing (WPF) application I have a CurrentViewModel property on my ShellViewModel which I bind to a content control in the ShellView.

I then use DataTemplate resources to render the appropriate View in the Conent control like so:

<ResourceDictionary>
    <DataTemplate DataType= "{x:Type help:HelpViewModel}">
        <help:HelpView />
    </DataTemplate>

    <DataTemplate DataType= "{x:Type home:HomeViewModel}">
        <home:HomeView />
    </DataTemplate>

..etc.

Is it possible to do something similar with Xamarin Forms, the Xamain DataTemplate does not have a DataType property.

Thanks in advance
Dave


YouTube player Video

$
0
0

I am making a mobile app cross-platform Xamarin forms. In iOS, YouTube player is great, it has all features I would to use like full screen, caption ..etc.
While in Android, the YouTube player doesn't support full screen, like iOS does. Any suggestion or solution? May Thanks

Generate a WCF client proxy for a netstandard Xamarin.Forms project

$
0
0

I've created a Xamarin.Forms project with a netstandard2.0 targeting library instead of a shared or PCL library. So far this compiles and works. I'm using an up2date version of Visual Studio 2017 Community.

I also have created a WCF service that gonna be hosted on windows itself (not IIS). I've configured my app.config to provide a Metadata Exchange Endpoint:

<?xml version="1.0"?>
<configuration>
    <startup>
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
    </startup>
    <system.serviceModel>
        <services>
            <service behaviorConfiguration="MM.Server.ServiceServerBehavior" name="MM.Server.ServiceServer">
                <endpoint address="net.tcp://localhost:8730/MMServer/" binding="netTcpBinding" bindingConfiguration="NetTcpBinding_IServiceServer" bindingName="NetTcpBinding_IServiceServer_EndPoint" contract="MM.Contracts.IServiceServer">
                    <identity>
                        <dns value="localhost"/>
                    </identity>
                </endpoint>
                <endpoint address="hxxp://localhost:8731/MMServer/mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
                <host>
                    <baseAddresses>
                        <add baseAddress="net.tcp://localhost:8730/MMServer/"/>
                    </baseAddresses>
                </host>
            </service>
        </services>
        <behaviors>
            <serviceBehaviors>
                <behavior name="MM.Server.ServiceServerBehavior">
                    <serviceMetadata httpGetEnabled="true" httpGetUrl="hxxp://localhost:8731/MMServer/mex" />
                    <serviceDebug includeExceptionDetailInFaults="true"/>
                </behavior>
            </serviceBehaviors>
        </behaviors>
        <bindings>
            <netTcpBinding>
                <binding name="NetTcpBinding_IServiceServer" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions" hostNameComparisonMode="StrongWildcard" listenBacklog="10" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxConnections="10" maxReceivedMessageSize="2147483647">
                    <readerQuotas maxDepth="32" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="16384"/>
                    <reliableSession ordered="true" inactivityTimeout="01:00:00" enabled="false"/>
                    <security mode="None"><!-- TODO: Add more security later -->
                        <transport clientCredentialType="None" protectionLevel="None"/>
                    </security>
                </binding>
            </netTcpBinding>
        </bindings>
    </system.serviceModel>
</configuration>

This is a very simple configuration and I don't care about security for now. The service runs, successfully.

Now I cannot simply add a service reference to my Xamarin.Forms project, since netstandard does not provide System.ServiceModel.

I've found out that I can use the SLsvcUtil.exe from the Silverlight SDK to generate the client proxy for my WCF service that is compatible to Xamarin.Forms targeting netstandard instead, however I cannot get it running.

No matter how I try to use the SLsvcUtil.exe while my WCF service is running, I always get the error:

Error: An error occurred in the tool.
Error: Object reference not set to an instance of an object.

Here is my batch that I used to execute SLsvcUtil.exe:

set "namespace=*,MM.Services"
set "mexPath=hxxp://localhost:8731/MM/mex"
set "svcutil=C:\Program Files (x86)\Microsoft SDKs\Silverlight\v5.0\Tools\SLsvcUtil.exe"
set "outputDir=C:\vsproj\Xamarin\MM\MM.App"
"%svcutil%" %mexPath% /directory:"%outputDir%" /namespace:"%namespace%"
pause

The localhost mex address returns the full WSDL, successfully.

How can I get a working generated client proxy for my Xamarin.Forms app that is targeting netstandard2.0? I'm open for any alternative that leads to the same desired result.

Align Bottom

$
0
0

How would I go about aligning the second StackLayout to the bottom of parent RelativeLayout? Thanks.

            <RelativeLayout x:Name="EventImageLayout" VerticalOptions="Start" HorizontalOptions="Center">

                <StackLayout VerticalOptions="Start" HorizontalOptions="Start">
                    <Image x:Name="EventImage" Source="http://tinyurl.com/lc7hnty" />
                </StackLayout>

                <StackLayout VerticalOptions="End" HorizontalOptions="Center" Padding="12,0">
                    <Label Text="{Binding Event.Name}" FontSize="Large" TextColor="#ffffffff" LineBreakMode="NoWrap" FontAttributes="Bold"/>
                </StackLayout>

            </RelativeLayout>

Entry View that binds to a double/int with a format property ?

$
0
0

I'm missing a "Entry" view that supports binding to a double or a integer - Preferable with formatstring property ?

Anyone knows of a view like that ?

Build for Ios

$
0
0

Hi,

I am developing a test app on Xamarin on Visual Studio 2017 on Windows. My project is a Xamarin.Forms project.

I am able to successfully deploy my Android project to my Android mobile.

I now would like to deploy the Ios project to a Ios emulator. I have a Mac for this purpose. Can I get some help on setting up the Mac to build the Ios app from my pc connecting to the build host on Mac? I saw some documentations on this but there was no detailed steps as to how to set up the Mac. Can you please point me to some documentation where I could find this?

thanks
Angelo

Debugging Xamarin.Forms

$
0
0

I have made a control which performs badly on UWP but performs well on Android. There are no custom renderers. The code is exactly the same on Android an UWP. I'm pretty sure the offending code is not in my library because I've put breakpoints on every method and while the sample app is churning away, these methods are not getting hit. I've also tried performance profiling the control and it's not spending any time in my code. I'm pretty sure that the performance is getting eaten up in the Xamarin.Forms library somewhere. Rather than just reporting it as a bug, I'd like to profile the XF code and try to pinpoint what is going on.

In particular, I need to be able to debug a scenario where there is a central PCL/.NET Library which references Xamarin.Forms. Could someone please give me a hand on debugging the XF library? Is there a tutorial somewhere? Is there a sample repo for debugging Xamarin Forms with a central PCL library?

The thing that is bringing me unstuck is that the PCL/.NET Standard library that needs to reference the Xamarin.Forms.Core library. But, every time I try to add a reference to it, I get this error:

This doesn't really make sense because the Xamarin.Forms.Core library is a PCL library as far as I can tell. Although the properties of the project say this:

To repro my scenario:

  • Clone this repo: https://github.com/MelbourneDeveloper/Adapt.Presentation.git in to C:\GitRepos\Adapt.Presentation
  • Switch to branch AdaptTreeViewItemProviderXFDebug
  • Clone the Xamarin.Forms repo in to C:\GitRepos\Xamarin.Forms
  • Open the Adapt.Presentation solution
  • You may need to fiddle around with the Xamarin.Forms libraries a little to get them to compile
  • Try to add a reference to Xamarin.Forms.Core from the project Adapt.PresentationSamples.Standard
  • Notice the error message

@DavidOrtinau

Hide tab bar on push

$
0
0

I would like to hide the tab bar of a TabbedPage when a specific page is pushed with Navigation.PushAsync(). In iOS UIViewController.hidesBottomBarWhenPushed does the job, is there any way to do the same with Xamarin.Forms? Or is there a method/property to hide the tab bar? I can't seem to find anything.


stacklayout rounded corners border radius

$
0
0

hi,

I have a forms app with a standard contentpage with a blue background. In the center of the page there is a stacklayout with some controls and a white background. But the corners of my stacklayour are not rounded and thats not so beautifull. Is there a way o get rounded corners?

how to "!" in a binding in xaml

$
0
0

i.e.

`

    <Button Clicked="OnLoginClicked"
        Image="Images/Login/loginWithFacebookButton.png"
        IsEnabled="{!(Binding IsLoggingIn)}"  <<<<<<< this is the bit that I don't know how to do.

`

Do I just have to add a waiting variable too? (hope not).

Clicked answer on the wrong one!! - this is my preferred answer:

<Button Clicked="OnLoginClicked" Image="Images/Login/loginWithFacebookButton.png" IsEnabled="{!(Binding IsLoggingIn.Equals(false))}"

How to change toolbar colors?

$
0
0

Hi, first time asking a question here. I've spent hours losing my mind trying to add a toolbar to my app and style it to my liking. I finally got it to show up, but cannot figure out how to simply change the background and text colors. I've tried many different things found on these forums and on other websites but nothing has worked so far.

Here are my files:

MainPage.xaml
(taken from this project)
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="MyApp.MyPage"> <ContentPage.ToolbarItems> <ToolbarItem Text="edit" Order="Primary"> <ToolbarItem.Icon> <OnPlatform x:TypeArguments="FileImageSource" iOS="edit.png" Android="ic_action_edit.png"/> </ToolbarItem.Icon> </ToolbarItem> <ToolbarItem Text="search" Order="Primary"> <ToolbarItem.Icon> <OnPlatform x:TypeArguments="FileImageSource" iOS="search.png" Android="ic_action_search.png"/> </ToolbarItem.Icon> </ToolbarItem> <ToolbarItem Text="refresh" Order="Primary"> <ToolbarItem.Icon> <OnPlatform x:TypeArguments="FileImageSource" iOS="reload.png" Android="ic_action_refresh.png"/> </ToolbarItem.Icon> </ToolbarItem> <ToolbarItem Text="explore" Order="Secondary" /> <ToolbarItem Text="discover" Order="Secondary" /> <ToolbarItem Text="evolve" Order="Secondary" /> </ContentPage.ToolbarItems> </ContentPage>

MainPage.xaml.cs
using Xamarin.Forms; namespace MyApp { public partial class MyPage : ContentPage { public MyPage() { InitializeComponent(); } } }

App.xaml
<Application xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="MyApp.App"> <Application.Resources> <ResourceDictionary> <Color x:Key="accentColor1">#F85A2F</Color> <Color x:Key="accentColor2">#C94A28</Color> <Color x:Key="primaryColor1">#222222</Color> <Color x:Key="primaryColor2">#2E2E2E</Color> <Color x:Key="backgroundColor1">#FFFFFF</Color> <Color x:Key="backgroundColor2">#F8F8F8</Color> <Color x:Key="textColor">#757575</Color> <Style TargetType="NavigationPage"> <!-- Doesn't change anything! --> <Setter Property="BarBackgroundColor" Value="Color.Red"/> <Setter Property="BarTextColor" Value="#FFFFFF"/> </Style> </ResourceDictionary> </Application.Resources> </Application>

App.xaml.cs
using Xamarin.Forms; namespace MyApp { public partial class App : Application { public App() { InitializeComponent(); MainPage = new NavigationPage(new MyPage()); } } }

MainActivity.cs
using Android.App; using Android.OS; using Android.Content.PM; namespace MyApp.Droid { [Activity(Label = "My App", Theme = "@style/AppTheme", ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.ScreenSize)] public class MainActivity : Xamarin.Forms.Platform.Android.FormsAppCompatActivity { protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); Xamarin.Forms.Forms.Init(this, bundle); App app = new App(); LoadApplication(app); } } }

styles.xml
(note that I do have a colors.xml but didn't think it was necessary to include it)
<resources> <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimaryDark">@color/colorPrimaryDark</item> <item name="colorAccent">@color/colorAccent</item> <item name="windowNoTitle">true</item> <item name="windowActionBar">false</item> </style> </resources>

So with this code I'm able to see my toolbar with the correct layout and items, but there seems to be no way to change the background or text colors. However, I think the problem (at least with the background) might just be that the toolbar is transparent because setting "android:windowBackground" in styles.xml to something besides white not only changes the page background but also the background of the toolbar. As you can see I already tried setting "BarBackgroundColor" and "BarTextColor" in App.xaml, but it does nothing. I also tried putting its equivalent in App.xaml.cs, but that failed too.

Hoping someone has some information about this since I can't find anything helpful.

How to add checkbox control in XAML

$
0
0

Hi,

I want to add Checkbox control in Xaml page. I added below code in .Xaml page.

    <CheckBox Margin="10, 10, 3, 3"
                  Name="acceptPolicy"
                  Content = "Accept our policy"
                  FontSize="12"
                 Checked="CheckBox_Checked"/>

But i am getting below error?

Error CS0246: The type or namespace name 'CheckBox' could not be found (are you missing a using directive or an assembly reference?)

I am new to Xaml, since i am unable to find Checkbox control in Xamarin.Forms Xaml, i tried to use default Checkbox from here.

If some controls doesn't exist in Xamarin.Forms Xaml, whether can i use default Xaml controls or not?

MVVM Light - How to use the selectedIndexChanged event in viewModel

$
0
0

Hi !
I try to use the selectedIndexChanged event in my viewModel but when i write this :

I have the following error :
"No Property of name SelectedIndexChanged found"

Anyone can help me ?
Thanks !

Viewing all 77050 articles
Browse latest View live


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