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

Popup Page with Editer multi line not working?

$
0
0

I have description Editer i need to show the complete text but editer not go to the next line and also text is not visible. Following is my code. One more thing my page is Popup page and the property of Autosize is not avilable




            <Entry x:Name="txtDescription" Placeholder="Description" HeightRequest="100"  WidthRequest="10" FontSize="Small" MaxLength="200" HorizontalOptions="FillAndExpand"/>
            <StackLayout Orientation="Horizontal">
                <Button x:Name="btnSave" Text="Save"/>
                <Button x:Name="btnCancel" Text="Cancel"/>

            </StackLayout>
        </StackLayout>


    </Frame>
</ContentView>

iOS 13.0 Broke MasterDetailPage on iPads?

$
0
0

I have noticed that after updating iOS to v13.0, the MasterDetailPage is broken on iPads but it's still working on iPhones and Androids.
By broken I mean the whole page is white, without content.


The only way to fix this is to update Xamarin.Forms to the latest v4.2+.

The problem is that some other packages are not compatible (XF broke something else after v4.0) so I cannot update XF yet.
The App Store is rejecting my app because it shows a white screen on iPads with iOS 13.0+....so I would have to stop targeting iPads!

Try for yourself, here is a basic sample repo with MasterDetail page (the default Xamarin Forms template with MasterDetailPage).
https://github.com/stesvis/MasterDetailTest2

The same happens with Prism MasterDetailsPage:
https://github.com/stesvis/MasterDetailTest

  • iPhones: works
  • iPad -> iOS 12.2: works
  • iPad -> iOS 13.0: white screen

Any solution for this HUGE headache?

Face exception in some device when click in entry "Java.Lang.NullPointerException: 'activityToken'"

$
0
0

face exception in on focused entry in some device like Samsung j7.

"Java.Lang.NullPointerException: 'activityToken'"

Post and Get Parameter In Webview

$
0
0

Hi,

Anyone knows on how to post url with parameters to payment gateway using webview in xamarin page? And get method to process the response received from payment gateway?

Thank you.

How to Hide button on Button click IsVisible property not works

$
0
0

I have to hide the button on button click and visible the other button on button click. But the IsVisible property not works. Please guide what is wrong and how to implement this?

if (SQLHelper._MeetingID == 0)
{

                    btnStartMeeting.IsVisible = true;
                    btnMarkAttendance.IsVisible = false;



                }

What is the best approach to dynamically show/hide input controls

$
0
0

Hi there,

I am a web developer getting into mobile development, so I'll do my best to make myself clear...

I need to create a single page input form and would like to add dynamic displayed input fields.
In other words I want to display or hide specific controls based on check box or dropdown list selections BEFORE submission, so event based functionality.

I'm just not familiar with all the container / control types available in xamarin yet, so I'm asking for some good advice here.. with that said, what is the best approach to accomplish this in Xamarin.Forms?

Any hint is really appreciated!
Best regards
Bruno

How to highlight newly added item to CollectionView

$
0
0

I am using Xamarin forms.I have CollectionView in Xamarins showing List of Tickets.I want to highlight new rows whenever its inserted.Like flashing or blinking the row with red background say for 5 seconds.After 5 seconds it should be normal row. Clients will add rows in real time using SignalR.


<CollectionView.ItemTemplate>

                        <Frame x:Name="frame1" BackgroundColor="White" BorderColor="#F0F0F0" Padding="3" Margin="0,0,0,5" HasShadow="False" CornerRadius="10" DescendantAdded="Frame_DescendantAdded">
                            <Grid HeightRequest="40" HorizontalOptions="FillAndExpand" VerticalOptions="Start">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="2*"/>
                                    <ColumnDefinition Width="2*" />
                                    <ColumnDefinition Width="6*" />
                                </Grid.ColumnDefinitions>

                            <Label Grid.Column="0" x:Name="lb_TicketNumber" Text="{Binding TicketNumber}" TextColor="Black" FontSize="Large" FontAttributes="Bold" VerticalOptions="Center" Margin="20,0" HorizontalTextAlignment="Center"  />
                            <Label Grid.Column="1" Text="{Binding DeskName}" TextColor="Black" FontSize="Large" FontAttributes="Bold" VerticalOptions="Center" HorizontalTextAlignment="Center"/>
                            <Label Grid.Column="2" Text="{Binding ServiceNameEng}" TextColor="Black" FontSize="Large" FontAttributes="Bold" VerticalOptions="Center" HorizontalTextAlignment="Center" />

                            </Grid>

                        </Frame>

                </DataTemplate>
            </CollectionView.ItemTemplate>

        </CollectionView>

Xamarin.CardIO documentation or examples.

$
0
0

Hello. A want scan debit/credit card data (card number, holder name etc.) using smartphone camera. I found Xamarin.CardIO.iOS and Xamarin.CardIO.Android libraries, but there are no any documentation or examples how to use it. In the end I want to create some Xamarin Forms control for using it from XAML. But now I need any documentation or examples. Could someone help me?


Google Drive API - SingIn Authentication - Not invoking CustomUrlSchemeInterceptor

$
0
0

After tapping 'Allow' in google sign in, the control is not directed back to app. I found that the 'CustomUrlSchemeInterceptor' is not invoked at all. But this is happening in in one app (production) but not in others (exploratory samples).

What am I missing?

Initialization in MainActivity is same in all apps. The coding for CustomUrlSchemeInterceptor is also same. Client IDs and Package Name are correct.

Popup page with lottie return after animation is ready

$
0
0

Made a Popuppage with a Lottie animation .

Start the PopupPage with a ButtonClick

But how do i close it after the Lottie animation is done ?

async private void Button_Clicked(object sender, EventArgs e)
        {

           await PopupNavigation.Instance.PushAsync(new Plaatje());
        }


<?xml version="1.0" encoding="utf-8" ?>
<pages:PopupPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:d="http://xamarin.com/schemas/2014/forms/design"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             mc:Ignorable="d"
              xmlns:pages="clr-namespace:Rg.Plugins.Popup.Pages;assembly=Rg.Plugins.Popup"
    xmlns:animations="clr-namespace:Rg.Plugins.Popup.Animations;assembly=Rg.Plugins.Popup" xmlns:forms="clr-namespace:Lottie.Forms;assembly=Lottie.Forms"
                 x:Class="Lottietest.Plaatje">
    <pages:PopupPage.Animation>
        <animations:ScaleAnimation 
            PositionIn="Center"
            PositionOut="Center"
            ScaleIn="1.2"
            ScaleOut="0.8"
            DurationIn="300"
            DurationOut="400"
            EasingIn="SinOut"
            EasingOut="SinIn"
            HasBackgroundAnimation="True"/>
    </pages:PopupPage.Animation>
    <!--You can use any elements here which are extended from Xamarin.Forms.View-->
    <StackLayout>
        <forms:AnimationView 
                x:Name="AnimationView" 
            IsVisible="True"
                Animation="Nointernet.json" 
                AutoPlay="True" Loop="false"
            HeightRequest="120"
            WidthRequest="120"
            VerticalOptions="CenterAndExpand"
                HorizontalOptions="CenterAndExpand" />


    </StackLayout>
</pages:PopupPage>

Whats is the Caching strategy for bindable layout?

$
0
0

Currently I'm using List view inside a scroll view and it is required in my project. But there is an abnormal behavior with list view inside a scroll view. I thought to use the bindable layout as stack layout which is having flexibility to having scroll view as parent.
I have few queries as below
Is the bindable layout with stack layout fast rendering as list view?
Is the bindable layout has caching strategy as list view if not what is the default caching strategy for bindable layout?
Can I use bindable layout for around 100 number of rows?

Please suggest!!
Thanks In advance!!

How can i create a patch like DLC for game in my App

$
0
0

I need to create a module or patch in my App. The user will choose what game among the numerous options to choose. Is there any plugin or anything?

Binding Base64 Image XAML

$
0
0

Hi,

i try to bind a Base64 (ImageResourceStream) to an image in XAML but end up everytime in an unhandled exception.

This is my code:

ViewModel:

        private ObservableCollection<WebImageSource> _imageSources;
        public ObservableCollection<WebImageSource> ImageSources
        {
            get
            {
                return _imageSources;
            }
            set
            {
                if (_imageSources != value)
                {
                    _imageSources = value;
                    OnPropertyChanged(nameof(ImageSources));
                }
            }
        }

        public GalleryViewModel()
        {
            Title = "Galery";

            _testService = new TestService();
            ImageSources = new ObservableCollection<WebImageSource>();

            this.OnOpenView += async (o, e) =>
            {
                ImageSources = new ObservableCollection<WebImageSource>((await _testService.Get()));
            };
        }

WebImageSource just contains a property named Base64 and some meta data.

This is my View:

<?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="MyApp.Views.GalleryPage"
             xmlns:c="clr-namespace:MyApp.Converters"
             Title="{Binding Title}" >
    <ContentPage.Resources>
        <ResourceDictionary>
            <c:Base64ImageSourceConverter x:Key="ImageConverter" />
        </ResourceDictionary>
    </ContentPage.Resources>
    <StackLayout>
        <ListView ItemsSource="{Binding ImageSources}">
            <ListView.ItemTemplate>
                <DataTemplate>
                    <ViewCell>
                        <Image Source="{Binding Base64, Converter={StaticResource ImageConverter}}}"  Grid.Row="0" 
                        Grid.RowSpan="3" Grid.Column="0" 
                        HorizontalOptions="Center" HeightRequest="50" 
                        VerticalOptions="Center">
                        </Image>
                    </ViewCell>
                </DataTemplate>
            </ListView.ItemTemplate>
        </ListView>
    </StackLayout>
</ContentPage>

At least the converter:

public class Base64ImageSourceConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var base64 = (string)value;

            if (base64 == null)
                return null;

            return ImageSource.FromStream(() =>
            {
                return new MemoryStream(System.Convert.FromBase64String(base64));
            });
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotSupportedException();
        }
    }

The converter is entered without problems and returns an ImageSource.
Seems that the exception is thrown on binding the new ObservableCollection to my view...

What i am doing wrong here? Can somebody help, please?

Xamarin forms: Issue with epubreader NuGet Package

$
0
0

I am using epubreader (vers-one) NuGet package for parsing .epub files.

My Code:

string fileName = "SampleEPUB.epub";
var assembly = typeof(MainPage).GetTypeInfo().Assembly;
Stream stream = assembly.GetManifestResourceStream($"{assembly.GetName().Name}.{fileName}");
EpubBook epubBook = EpubReader.ReadBook(stream);
foreach (EpubNavigationItem chapter in epubBook.Navigation)
{
    chapterDetails.Add(new ChapterDetails() { title = chapter.Title, htmlData = chapter.HtmlContentFile?.Content, subChapters = chapter.NestedItems });
}

1 When parsing the epub file like above, I am getting only one chapter(chapter name is content). If I click that chapter there is no data.

2 When we open that epub files using Adobe Digital Editions 4.5.11, there are a lot of chapters and contents. I need to parse all the chapters and TOC in the epub file. Please help me to find the issue behind this.

3 Also tried epubreader.cross NuGet package, but that project is deprecated. Are there any other NuGet packages for parsing epub files?

4 Currently, I have added sample epub files to the project and implemented parsing for it. Instead of that if the epub file is a link how I can manage it?

I have added a sample project here having .epub files for the reference. I have already posted a question related to this, but it not solved my problem completely.

How do I get the tabreselect event with tabbar at the bottom on android?

$
0
0

I'm trying to get an event firing when tab item of tabbedpage is reselected.

I've searched trough the forum and found that on Android, I need to create a customrenderer with

void TabLayout.IOnTabSelectedListener.OnTabReselected(TabLayout.Tab tab)
{
//do something
}

But it only triggered when the tabbar is on top.

If is set the tabbar placement to bottom with
On<Xamarin.Forms.PlatformConfiguration.Android>().SetToolbarPlacement(ToolbarPlacement.Bottom);
The "OnTabReselected" above won't be triggered.

So, how do I get the tabreselect event with tabbar at the bottom on android?

Thanks.


White Image (png icon) in Green Frame

$
0
0

Hello everyone,

this question might be simple but I tried already everything.
I want the outer frame, which has a green BG color, contain a white image -> the ic_add_custom_24dp.png, which is nothing more than a white
+.

            <Frame Style="{DynamicResource FrameButton}">
                <Image  Source="ic_add_white_24dp.png"
                           BackgroundColor="Transparent"
                           Aspect="AspectFit"
                           HorizontalOptions="CenterAndExpand"
                           VerticalOptions="CenterAndExpand">
                    <Image.GestureRecognizers>
                        <TapGestureRecognizer Command="{Binding SomeCommand}"/>
                    </Image.GestureRecognizers>
                </Image>
            </Frame>

The strange thing is, if I set the BG Color of the Frame to white, I expect to see nothing right?
But I see a grayish +. So something is messing with me.

How can I set the + to be white?

Tab Bar Icon Sizing

$
0
0

Hi there, trying to change size of my tabbar icons without having to make a certain size for each device. I read somewhere that you can do an AspectFill to maintain aspect ratio but it didnt work for me. Go easy on me, somewhat new to this! Here is the code..
`public class MainNavigation : TabbedPage
{
public MainNavigation ()
{
FileImageSource seriesImage = new FileImageSource();
seriesImage.File = "series.png";
//seriesImage.WidthRequest = "AspectFill";

        Children.Add(new NavigationPage (new SeriesPage ()) {
            Title = "Series",
            BarBackgroundColor = Color.FromHex("#ededed"),
            BarTextColor = Color.FromHex("#e46769"),
            Icon = seriesImage,
        });
        Children.Add(new NavigationPage (new BlogPage ()) {

            Title = "Blog",
            BarBackgroundColor = Color.FromHex("#ededed"),
            BarTextColor = Color.FromHex("#e46769"),
            Icon = "blog.png",

        });
        Children.Add(new NavigationPage (new AboutPage ()) {

            Title = "About",
            BarBackgroundColor = Color.FromHex("#ededed"),
            BarTextColor = Color.FromHex("#e46769"),
            Icon = "cross.png",

        });



    }
}`

Browsing SQL Lite database on Android Emulator

$
0
0

I am currently trying to find a way to browse the SQL Lite database that my app creates on an android emulator. All the postings out there indicate that while my app is running on the emulator, in visual studio I need to open Android Device Mointor, and under file explorer do a pull from the data\data folder onto my local system (windows 10). I can then browse the files, including the database of my app.

However unlike all the postings, my data folder is either empty or simply does not have the .db file that I am expecting to find.

I have tried this method on the following emulators.

  • Pixel 2 Pie 9.0 API 28
  • Oreo 8.0 API 26
  • Marshmello 6.0 API 23
  • Lolipop 5.0 API 21

The latest versions (pixel / oreo) dont even allow you to browse the data folder (expanding it in file explorer comes up empty). The older versions have data in their data folders but not no .db files affilicated with my app. Just a bunch of .so files.

My Development Environment

  • Visual Studio 2019
  • Windows 10

Would really appreciate input here as its all but impossoible to develop seriously without access to the database on an android device.

Xamarin Forms CollectionView

$
0
0
Hello everyone
Please am working on a shopping application and am using collection view to list my categories of products. Now I want to list the items based on the category selected in another page.
Please can some help me with this out please 🙏

Native Svg support in Xamarin

$
0
0

Is there anyway to load svg files natively not using skiasharp? FFimageloading works mostly but there are several cases that it doesnt really load svg file correctly. Is there anyway to load svg files on platform specific without using skiasharp? any existing plugin?

Viewing all 79144 articles
Browse latest View live


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