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

Checkbox with Xamarin.Forms

$
0
0

Hi everyone, I have been using Checkbox from Xlabs for a long time but I'm having trouble with it, since I can't change the color of the checked box.
The problem is that this color is almost the same as the color of selected row in ListView (and I can't change that either).

I have tried using the InputKit library, but can't install it from nuget, since it doesn't target my PCL profile.
Is there any simple checkbox implementation out there that is worth using?


Create ToolbarItems using template or some other dynamic mechanism.

$
0
0

Hi guys,

I have few common toolbar items which I want to add on every view of the application.
(Though there are some specific items per view, however let's not worry about them right now.)

What I want is to add these common toolbar items via a template or external file/code in XF - PCL.

I tried the following code which gets compiled without error, however crashes, I am not sure how I can overcome this issue.

MainPage.xaml: (Note the xmlns:mnu)

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:mnu="clr-namespace:Toolbarz.Views;assembly=Toolbarz"
             xmlns:prism="clr-namespace:Prism.Mvvm;assembly=Prism.Forms"
             prism:ViewModelLocator.AutowireViewModel="True"
             x:Class="Toolbarz.Views.MainPage"
             Title="MainPage">
    <mnu:ToolBarMenu></mnu:ToolBarMenu> <!--THIS GETS COMPILED HOWEVER DOES NOT WORK-->
    <!--
         THIS CODE WORKS
         <ContentPage.ToolbarItems>
             <ToolbarItem Text="Help" Priority="0" Order="Secondary"/>
             <ToolbarItem Text="License" Priority="0" Order="Secondary"/>
             <ToolbarItem Text="About" Priority="0" Order="Secondary"/>
         </ContentPage.ToolbarItems>-->
    <ContentPage.Content>
    <StackLayout HorizontalOptions="Center" VerticalOptions="Center">
        ....
    </StackLayout>
    </ContentPage.Content>
</ContentPage>

ToolBarMenu.xaml

<?xml version="1.0" encoding="UTF-8"?>
<ContentView xmlns="http://xamarin.com/schemas/2014/forms" 
    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="Toolbarz.Views.ToolBarMenu">
    <ContentPage.ToolbarItems>
        <ToolbarItem Text="Help" Priority="0" Order="Secondary"/>
        <ToolbarItem Text="License" Priority="0" Order="Secondary"/>
        <ToolbarItem Text="About" Priority="0" Order="Secondary"/>
    </ContentPage.ToolbarItems>
</ContentView>

Can you suggest what's wrong with this approach?
OR
Could you please suggest any solution which will help me use the ToolbarItems using some template?

Thanks.
N Baua

Master details page design

$
0
0

Hi,

can any body please help me how to design master details page like attached.

Thanks.

How to implement localization in the latest 2017 VS without using PCL?

$
0
0

Hello

In previous projects I used the resx/PCL approach to implement localization in my Xamarin.forms solutions. As of the update to VS, this has been deemed deprecated and the information I find instruct me to "use the .NET standard".

When trying to implement a resx language file, the strongly typed connection is no longer available and the ResXFileCodeGenerator tool for converting resx to designer.cs "does not exist in a non .NET environment".

VS still allows me to add a PCL project to my Xamarin.forms, but since it has officially been depricated, I do not want to use that.

The article at Xamarin describing how to do it (https://developer.xamarin.com/guides/xamarin-forms/advanced/localization/), has yet to be updated to use .NET standard, where the resx file is automatically converted into a designer.cs file, that used to enable the strongly typed use of strings.

Are there anyone out there that could help me create a way to use localization in the latest VS 2017 (for Mac) without using a PCL nor individual implementation of localization in separate platforms (Andorid/iOS)?

3D Touch in forms (including peek/pop!)

Sqlite Database not losing changes while debugging but works fine when not debugging

$
0
0

Hi, I'm using latest Xamarin Forms 3.2. When I debug by Sqlite based app, it appears as though updates to the database are being lost when I stop the debugger. When I run the app on the device (not in debug) I can't reproduce the problems.

Are there any known issues with the debugger and Sqlite?

auto save data when OnSleep occurs

$
0
0

I am trying to save data from a Navigation page whenever OnSleep occurs. For the life of me, I can't remember how to reference the OnSleep from my navigation page. I would store the data in the OnSleep in App into a Application.Current.Properties["saleslocationcode"] . Then repopulate the view when I resume. Can someone point me to an example, or is there an easier way?

How can I customize the border of stack Layout?

$
0
0

I have created a square blocks using stack layout and have some elements inside the stack layout and now i want to customize the border color of stack layout? Can anybody let me know how can i create custom renderer for stack layout?


Aligning text and image on Button separately

$
0
0

I want my button to look like this:

In an attempt to make this happen, I've used XLabs.forms. In order to combine XLabs' ExtendedButton and ImageButton, I copied their implementation of ExtendedButton into my project and set it to inherit from ImageButton.

This is how it turned out:

So what's happening here is that the control includes my image as specified, but fails to align it separately from the text (Orientation="ImageToRight"). This is probably because of HorizontalContentAlignment, which (correctly) sets the text to "Start":

However, I suspect that even if it did align the image separately from the text, it still wouldn't do what I'd like it to do. I think it would look something like this:


Is there any practical way to make my button look like the first image at all using forms? Some way to create several items within a button, and set the gravity separately for each item? Or is forms too limited for this sort of customisation?

UITest for Splash Screen

$
0
0

I have a splash screen which will be open for like 2-3 seconds.
I need to do a testing of splash screen on different device.
How can I achieve it as I have already tried app.Screenshot("") method but it's not taking the screenshot of splash screen but the home page.
I can take the screenshot of splash and compare with it splash Image..But how can I compare screenshot with splash image file?

app = AppInitializer.StartApp(platform);
app.Screenshot("Splash Screen"); //It's not taking the screenshot of splash screen but home screen

Grid Paging buttons, how to add dynamic paging buttons

$
0
0

In grids, the page numbers available based on the selected page size should be visible at the bottom of the grid. By clicking on a page number the user will navigate to the appropriate page.

Only want to show the Current Page number and 5 pages before and after.
If there are more than 5 pages before or after, show an ellipses (...) to indicate that we have more records.

Example: on page 8 of 20:
... 3 4 5 6 7 8 9 10 11 12 13 ...

Xamarin.UITest : UItest for Splash Screen

$
0
0

How to do a UI test for splash screen?

Xaml C# how use x:Name

$
0
0
             x:Class="AppMobile.Views.About">
    <ContentPage.Content>
        <StackLayout>
            <Editor x:Name="editor1" Text="EDITOR1 TEXT" TextChanged="textEditorChanged"></Editor>
      <Editor x:Name="editor2" Text="EDITOR2 TEXT" ></Editor>
        </StackLayout>
        [XamlCompilation(XamlCompilationOptions.Compile)]
        public partial class About : ContentPage
        {
            public About ()
            {
                InitializeComponent ();
                SetTextEditor();
            }


                Editor editor1 = new Editor();
                public void TextChangedEvent(object sender, TextChangedEventArgs e)
                {
                    editor1.Text = e.OldTextValue;
                }
                            Editor editor2 = new Editor();
                 public void SetTextEditor()
                {
                        editor2.Text = "NEW text EDITOR2";
                 }

        }
}

Error Position 10:59. EventHandler "textEditorChanged" not found in type "AppMobile.Views.About" PictureCodeAppMobile D:\Pic\mobile\AppMobile\AppMobile\Views\About.xaml 10

What you need to do to make it work.
How to use X: Name.
I'm used to the fact that no one wants to give a good answer or set an example. Only links.

Best way to integrate spotify to xamarin.forms applicaiton

$
0
0

Hi all,

Can someone point me to a proper way to play music from spotify in my xamarin.forms application?

What would be the best approach: can we use their web api to play music, are there some libraries for xamarin (I can't find any), should we try to link iOS / Android libraries from spotify (and did anyone had any experience with this)?

ItemSource Property of Picker

$
0
0

Hi Everyone,
I am trying to the binding list of data in the picker. I am using a view model, web services.

    var response = kitchenDetailServices.GetAllKitchen(BaseClass.UserId, BaseClass.Token);

              weight_picker.ItemsSource = new List<string>();
              foreach (var item in response.parameters)
              {
                 weight_picker.ItemsSource.Add(item.kitchen_name);
               // weight_picker.ItemsSource = item.kitchen_name[0];
            }

xaml

 <controls:JarPicker x:Name="weight_picker" Title="Select Kitchen" TextColor="LightGray" VerticalOptions="Center" HeightRequest="40">
     </controls:JarPicker>

But picker is not showing the items?

help


I need custom info window with multiple line text in mkmap view any relevant reference for that ??

$
0
0
I need custom info window with multiple line text in mkmap view any relevant reference for that ??

How do i achieve a sleek calendar UI with Xamarin Forms like the one below?

$
0
0

Good day everyone.
I'm kind of new with Xamarin Forms and i'm creating an app which would require a sleek calendar view like the one in the image below.
Any ideas please?

Issue on iOS when pushing modal on master detail during application startup.

$
0
0

I have an unusual problem only appearing on iOS. After setting the main page (master detail) I am doing long asynchronous task. When this task is finished I am pushing modally another page like this:

MainPage = new MasterDetail();
await FetchSthFromDb();
MainPage.Navigation.PushModalAsync(new SomePage());

I got the following error:

Warning: Attempt to present <Xamarin_Forms_Platform_iOS_ModalWrapper: 0x7f9eb84694f0> on <Xamarin_Forms_Platform_iOS_PlatformRenderer: 0x7f9eb8444d80> whose view is not in the window hierarchy!

This error only appears on iOS. On Android everything is working fine. Did anyone encounter sth similar?

Create DataGrid in xamarin with column rearranging facility.

$
0
0

I want to create a DataGrid with column rearranging facility . I don't want to use third party DataGrids and also avoid custom renderers.

How to implement Link Preview in Xamarin froms?

Viewing all 77050 articles
Browse latest View live


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