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

Accessibility Problem: VoiceOver read AutomationProperties.Name but didn't read Text !

$
0
0

Hello World!!
We aims to support accessibility in our Xamarin.forms App but when we Add AutomationProperties.Name to the label the VoiceOver read it and never read the Value of Text property

here is the code

<controls:ExtendedLabel x:Name="MSGLBL" Margin="8,0" HorizontalOptions="EndAndExpand" VerticalOptions="CenterAndExpand" TextColor="Gray" FontSize="12" Text="{Binding Msg_content}" AutomationProperties.IsInAccessibleTree="true" AutomationProperties.Name="{local:TranslateExtension ResourceId=LocalInboxDetails, Text=LBLMsgContent}">

Is there any solution or suggestions?

thanks !


Map page won't open unless location service is on

$
0
0

My map page loads fine and zooms into the user's current location when location is enabled. However, if I deny permission to use my location, the app freezes when I click on the map page and I get the following error:

Java.Lang.SecurityException: my location requires permission ACCESS_FINE_LOCATION or ACCESS_COARSE_LOCATION

However, I still want the map to load even when the user denies permission for location.

Xamarin Forms 4.3 Shell Search Handler how to disable query clear on complete

$
0
0

Hi!

I'm trying to integrate an app with the new Shell from Xamarin Forms 4.x. I'm using the latest 4.3 version (4.3.0.947036).

My issue is, when I tap the Enter button on the keyboard of the new SearchHandler that comes with Shell, the text on the searchbar automatically clears. I can't find a place where I can override or disable this behavior. I'm using a search per character inserted feature that I've created on a custom SearchHandler class, and when the search bar clears the search happens again with no characters (which I don't want).

Do you know any specific method or event that I can override or disable to avoid this "clear" behavior?

How to detect PopAsync back to MainView

$
0
0

There is my code:

    public partial class App : Application
    {
        public App()
        {
            MainPage = new NavigationPage(new MainPage());
        }
    }

    public partial class MainPage : ContentPage
    {
        private void Button_Clicked(object sender, EventArgs e)
        {
            this.Navigation.PushAsync(new ChannelPage());
        }
    }

public partial class ChannelPage : ContentPage
{
    private async void Channel_Clicked(object sender, EventArgs e)
    {
        await Navigation.PopAsync();
    }
}

When await Navigation.PopAsync(); run, the current page will back to MainPage.
The ChannelPage will modify some values,
so I need do some process when back to MainPage finish.

I want to know which override function can handle this event in MainPage?

how to set background on login page

$
0
0

Hi im wondering how can I set an image background in my login form using xaml I tried all I have found in google and nothing works

Is dependency injection setup on new project?

$
0
0

I created a new master detail project and I see in the constructor of the App.xml.cs there is this code...
DependencyService.Register();

Can anyone explain this?

The type or namespace name 'System' could not be found

$
0
0

When I try to create a new Xamarin Forms app, nothing works. No imports can be found. Almost every line in the autogenerated code has a "not found" error.

Using Visual Studio 2017 15.5.6 on Windows 10.

Can I prevent a TapGestureRecognizer from swallowing touches?

$
0
0

I have a custom ViewCell with an Entry in it. I'm using a TapGestureRecognizer in the cell so that I can give focus to the Entry regardless of where the user taps in the cell. In my custom ViewCells without TapGestureRecognizers, I'm able to manage the pressed effect on the cells (adjusting their background color) by using a custom renderer. Unfortunately, the tap effects aren't handled by the custom renderer if the TapGestureRecognizer processes the touch. This leaves me without any sort of pressed effect highlighting for tapping the cell. Is there some way I can prevent the Xamarin TapGestureRecognizer from swallowing touches?


Prevent orientation change for a page?

$
0
0

Is it possible to prevent individual pages from re-orient when the user rotates the device? I already know how to do it with native iOS but I was expecting a property on ContentPage or something similar.

How can I show an image in an image component using a link?

$
0
0

I've been trying so many differents way but without any result

Value binding

$
0
0

Can you bin the value in a binding condition in Multitrigger?

Picker BindingContext does not inherites from ContentPage BindingContext

$
0
0

Hello,
First, I am surprised that my Pickers BindingContext inherites from their parent StackLayout but not from the ContentPage. Is that normal?
Second, a picker inherites from its parent StackLayout BindingContext after the SelectedIndex is set. How to set the SelectedIndex after the Picker has inherited from its parent BindingContext?

this is my XAML code:

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="AlmicantaratXF.Views.SightPage"
             xmlns:i18n="clr-namespace:AlmicantaratXF.Views;assembly=AlmicantaratXF"
             xmlns:viewModels="clr-namespace:AlmicantaratXF.ViewModels;assembly=AlmicantaratXF"
             xmlns:converters="clr-namespace:AlmicantaratXF.Converters;assembly=AlmicantaratXF"
             xmlns:behaviors="clr-namespace:AlmicantaratXF.Behaviors"
             Title="{i18n:Translate titleSight}"
             BackgroundColor="{StaticResource AppBackgroundColor}">
    <!--   Title="{i18n:Translate titleSight}">     -->

    <ContentPage.BindingContext>
        <viewModels:SightPageViewModel/>
    </ContentPage.BindingContext>

    <ContentPage.Content>
        <StackLayout  Orientation="Vertical"
                      Margin ="0"
                      Padding="0">

<!--  If the StackLayout.BindingContext is commented out, the Pickers binding does not work
        as it is not commented out, the SightPAgeViewModel constructor is executed twice: one by ContentPage, second by StackLayout -->

            <StackLayout.BindingContext>
                <viewModels:SightPageViewModel/>
            </StackLayout.BindingContext>

                <Picker
                    x:Name="PickerBodyType" 
                        Title="Body Type"
                        ItemsSource="{Binding BodyTypes, Mode=TwoWay}"
                        SelectedIndex="1"
                        WidthRequest="120"
                        Margin="0">
                    <!--<Picker.BindingContext>
                        <viewModels:SightPageViewModel/>
                    </Picker.BindingContext>-->
                </Picker>

                <Picker 
                        x:Name="PickerLimb"
                        Title="limb"
                        WidthRequest="120"
                        Margin="0"
                        ItemsSource="{Binding Limb, Mode=TwoWay}"
                        SelectedIndex="0"
                        IsVisible="{Binding Source ={x:Reference PickerBodyType},
                                           Path=SelectedIndex,
                                           Converter= {StaticResource selectedItemToBool},
                                           ConverterParameter=1}">
                </Picker>

                <Picker 
                        Title="planets"   
                        WidthRequest="120"
                        Margin="0"
                        ItemsSource="{Binding Planets, Mode=TwoWay}"
                        SelectedIndex="0"
                        IsVisible="{Binding Source ={x:Reference PickerBodyType},
                                           Path=SelectedIndex,
                                           Converter= {StaticResource selectedItemToBool},
                                           ConverterParameter=2}" >
                </Picker>

                <Picker
                        Title="stars"   
                        WidthRequest="120" 
                        Margin="0"
                        ItemsSource="{Binding StarsCollection, Mode=TwoWay}"
                        SelectedIndex="0"
                        IsVisible="{Binding Source ={x:Reference PickerBodyType},
                                           Path=SelectedIndex,
                                           Converter= {StaticResource selectedItemToBool},
                                           ConverterParameter=3}" >
                </Picker>

        </StackLayout>
    </ContentPage.Content>
</ContentPage>

Advice to handle html files in external storage

$
0
0

Hi guys, i'm a xamarin newbie. I have developed a simple Forms app to display some particular html files (by webview). To store the files i've used embedded resource. Now i need to implement a mechanism to updates of that files...so i've developed an asp net mvc web api. When i call it returns to me a zipfile with updated contents (they must be stored in the sd card). In your opinion, what is the best way to handle a lot of html files stored in the sd storage? Must i copy them to Asset (or assets are write only..?) to visualize them?

Thank you very much for your advices, i'm a little bit confused.

What is wrong with my ReactiveUI routing set up?

Tool bar menu item xamarin forms

$
0
0
I would like to achieve similar tool bar menu item. I would like to add image in left and text in right. Image is font awesome icon. So I would like to create custom template with label . And show like this menu item . I have tried absolute layout with listview . It not working. I am thinking to use picker but it occupy full screen.but it needs to display like in image .. any one please help on this to overcome issue.

Thanks

MasterDetailPage - Bar at the top of the Detail's Page

$
0
0

Hi,
In my project, i made a Master Detail Page with a Detail page, but on this page, i have a bar a the top and i don't know why.
Does anyone already had this problem ?

Thanks !

Value cannot be null. Parameter name: type

$
0
0

Not sure what changed, but now when I build I get this error on every XAML file in my project. Has anyone ran into this issue before? Tried all of the usual fixes - del bin/obj, restart, clean rebuild, downgrade Forms...

Stacklayout Orientation Horizontal not working on Android after loading HTML File

$
0
0

Hey,

I'm using Xamarin.Forms to rendering my HTML File.
The Problem I can not lay out my labels horizontal on Android.

On UWP (see: "UWP.png" Attachment) its working fine.
On Android (see: "Android.png" Attachment). My horizontal Labels are all vertical.

My HTML File (see: HTML.png") using Attributes which will get parsed through own Renderer.
My Renderer picks up the key "horizontal" and translate this to Xamarin.Forms Keywords.

(see: "C#Code.png"). Here I'm debugging my Android Version.

So the question why its working on UWP but not on Android even Debugger shows horizontal.

How to add separator for toolbar items?

$
0
0
I need to add separator in between the toolbar items. For example I have 5 tool bar items. I need to separate those like add separator after 3rd tool bar item. Please help me on this.

Thanks in advance

ObservableCollection: Insert vs Add (Android)

$
0
0

Hi,
I have a Listview binded to an ObservableCollection 'HistoryList'.
When a button is pressed, a new item is added:

HistoryList.Add(new .....));

The new item appears at the end of the list, all works fine.
However, I want the new item to be inserted at the beginning instead of the end, so:

 HistoryList.Insert(0, new .....));

And here Listview starts to behave very strange: some items (usually every 2nd) are not drawn, etc. However when I start to scroll the listView, (most of the time) all becomes normal.

Is this a bug, or do I miss something?
VS2019 16.3.4 / XF 4.2.0.848062
I tried only on Android (so far)

Viewing all 91519 articles
Browse latest View live


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