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

ENLACE DE UN DATASET A UN DATAGRID EN XAMARIN FORMS

$
0
0

Cordial saludo.

Estoy aprendiendo Xamarin y me he encontrado con la necesidad de consultar los datos de una tabla en una base de datos SQL Server. He logrado realizar exitosamente la conexión, el DataAdapter y cargar el DataSet respectivo.

Ahora deseo visualizar al usuario los resultados en pantalla, pero no lo he logrado ya que no tengo idea de cómo usar el control DataGrid en Xamarin Forms.

He agregado el paquete Nuget Xamarin.Forms.DataGrid (versión 3.1.0) de Ebubekir Akgul

En el XAML creo el control así:

<datagrid:DataGrid x:Name="Clientes"

Previamente en el ContenPage agregando:

xmlns:datagrid="clr- mespace:Xamarin.Forms.DataGrid;assembly=Xamarin.Forms.DataGrid"

Ya en el XAML.CS he intentado lo siguiente:

Clientes.ItemsSource = dataSet.Tables["DATOS"].DefaultView;

No sale ningún error al ejecutar, pero solo se visualiza un espacio de color negro.

Agradezco por favor cualquier orientación al respecto, ya que no he podido encontrar nada en Internet, solo se ven otros paquetes Nuget que son de costo.

Gracias.


Adding Label or Text tag in layer-list

$
0
0

Hi

I need to add Label showing Version No of apk file.

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
  <item>
    <color android:color="@color/splash_background"/>
  </item>
  <item>
    <bitmap
        android:src="@drawable/splash_logo"
        android:tileMode="disabled"
        android:gravity="center"/>
  </item>
<item>
/****** Showing Label or Text like : Version No 1.0(Build 1.2)  *******/
</item>
</layer-list>

Regards
gsalunkhe

shell or ContentPage not rtl

$
0
0

hi
my project Shell

FlowDirection="RightToLeft" not working

example CarouselView read 20 items, Move images from left to right

How did the whole project align rtl?

How to store GPS data with a captured photo in Xamarin Forms using Camera2

$
0
0

We have been using the Xam.Media.Plugin for taking pictures. Now we need to capture pictures natively starting with Android. That part is working. So, now we need to also store the latitude and longitude with the image. Using Xamarin.Essentials GeoLocation we can get the lat and long as doubles. We have tried two ways to tie the geo to the image.

1) Our understanding is that using
_captureBuilder.Set(CaptureRequest.JpegGpsLocation, ??);
if we put the right thing where the ?? is the geo info will be on the image. We are not sure what format that should be. We can do:
string CoordinateToRational(double coord)
but how do we put both lat and long in? And in what format?

2) We also tried adding geo info into EXIF after saving the image by doing:
newExif.SetAttribute(ExifInterface.TagGpsLatitude, CoordinateToRational(lat)); newExif.SetAttribute(ExifInterface.TagGpsLongitude, CoordinateToRational(lon)); newExif.SaveAttributes();
where lat and long end up as string degrees, minutes and seconds. When we read the values back using:
ExifInterface testExif = new ExifInterface(filePath); float[] lalo = new float[2]; testExif.GetLatLong(lalo);
we get zeros.
Any guidance is appreciated.
Thanks in advance!

CollectionView Binding jump top

$
0
0

hi

After Binding CollectionView jump top

How can I be updated in the same situation

ITMS-90809:Deprecated API Usage-Apple will stop accepting submissions of apps that use UIWebView API

$
0
0

Yesterday, I uploaded my App to TestFlight and after a while, Apple sent me this warning:

ITMS-90809: Deprecated API Usage - Apple will stop accepting submissions of apps that use UIWebView APIs. See https://developer.apple.com/documentation/uikit/uiwebview for more information.

I am using WebView for showing HTML data in my app. Also, I have used WebView for playing audio and video. So is this warning reject my app when submitting for review or should I change these features with some other APIs?

In this link provided by AppStore, telling about use WKWebView instead of UIWebView, I tried that and no such property found on XAML. Should I need to install any packages for getting that feature? Also, by using WKWebView, is it possible to play audio, video and showing HTML data in the app?

How to compress a video in xamarin forms?

$
0
0

Currently i'm using this, but it's not working after android version 7.0.

string[] cmds = new string[] {
"-y",
"-i",
inputFilepath,
"-strict", "experimental",
"-vcodec", "libx264",
"-preset", "ultrafast",
"-crf","30", "-acodec","aac", "-ar", "44100" ,
"-q:v", "20",
"-vf",
"mp=eq2=1:1.68:0.3:1.25:1:0.96:1",
ouputFile,
};
Has anyone had this same problem and has a solution?

How to pass gesture to a View?

$
0
0

I have a stackLayout and collectionView.and put the StackLayout cover the collectionView and make it transparent.
So if I scroll the StackLayout can I pass the "scroll" to the collectionView?to make it scorlled.


Create a custom renderer for Frame with unique corner radius values [Xamarin.Forms]

$
0
0

I need really some help:
I have been searching about how can I create a custom renderer for a frame control that allows me to give every vertex a different radius but in every question posted in the forum people do not get into a "clear solution", I know how to create custom renderers in controls (only the basics of it) but when i create the custom renderer for frame i just didnt know how beacuse I tryed with android and the control is not being referenced correctly, I please need a solution for this, any help??

shell tabbar number badge

$
0
0

hi

How do I put a counter on this part?

<TabBar x:Name="rootTabbar" Route="tabbar">

    <Tab Title=" پروفایل من" Icon="User" TabIndex="0" Route="tab"   ??? counter>
        <ShellContent ContentTemplate="{DataTemplate page:User}" Route="profile"/>
    </Tab>

    <Tab Title=" سبد خرید" Icon="ShoppingCart" TabIndex="1" Route="tab"    ??? counter>
        <ShellContent ContentTemplate="{DataTemplate page:ShopingCart}" Route="shoppingcart"/>
    </Tab>

    <Tab Title=" دسته بندی" Icon="List" TabIndex="2" Route="tab"      ??? counter          >
        <ShellContent ContentTemplate="{DataTemplate page:Categorie}" Route="categorie"/>
    </Tab>

    <Tab Title=" صفحه نخست" Icon="Home" TabIndex="3" Route="tab"   ??? counter>
        <ShellContent ContentTemplate="{DataTemplate page:Main}" Route="home"/>
    </Tab>

</TabBar>

Xamarin.Forms Images not showing

$
0
0

I am developing a Cross-Platform app in Xamarin Visual Studio 2019 and having issues with image display.

I am trying to show an image with the following XAML code.

<StackLayout Grid.Row="0" Grid.Column="0" Spacing="0" >
    <Image
        HorizontalOptions="CenterAndExpand"
        VerticalOptions="CenterAndExpand"
        Source="logo"
        WidthRequest="{OnPlatform iOS=300, Android=250}">
    </Image>
</StackLayout>

The problem is an image not displaying on either preview or deployed app.

I took references from multiple forums including help from StackOverflow but couldn't tackle the issue.

Here are the points and methods I worked on to resolve the issue.

The file named gear is an android resource folder and is a proper .png file.
The property for the file is set to AndroidResource.
The filename does not have a hyphen in it, and also tried other posted answers on the same page.

Image size 307X80 pixels so it's well within range for memory or size.

Android Drawable folder also contains default xamarin_logo.png image and that file works fine. But not newly added images. Is there anything I am missing here to add these image files to the solution?

Xamarin forms: AppStore app page is not opening when new version is available?

$
0
0

I am using Plugin.LatestVersion NuGet package for checking new version availability.

My Code:

using Plugin.LatestVersion;

var isLatest = await CrossLatestVersion.Current.IsUsingLatestVersion();

if (!isLatest)
{
    var update = await DisplayAlert("New Version", "There is a new version of this app available. Would you like to update now?", "Yes", "No");

    if (update)
    {
        await CrossLatestVersion.Current.OpenAppInStore();
    }
}

In android and IOS, displaying an alert is working fine if a new version is available. In the case of the android app, if tap yes from the alert it will load the app page in the play store app.

But for ios, the app page is not loading when tap yes option form the alert. Cannot connect to AppStore is showing on the Appstore app.

Screenshot:

enter image description here

I have also tried await CrossLatestVersion.Current.OpenAppInStore("app bundle name");, but showing the same above screen on AppStore.

How to call an UIViewController from Xamarin.Forms?

$
0
0

I use Xamarin.Forms to create an app running on iOS and Android. If the app is running on iOS from the common code I want to call an UIViewController which is defined as "public partial class MyViewController : UIViewController, IUITableViewDelegate, IUIScrollViewDelegate". How can I do that?

In the common code normally we use Navigation.PushAsync (page) and page is derived from Xamarin.Forms.ContentPage.

Java.Lang.NullPointerException

$
0
0

hi
Java.Lang.NullPointerException: 'Attempt to invoke virtual method 'void android.graphics.Rect.set(android.graphics.Rect)' on a null object reference'

This error is very annoying

  • CollectionView read data

To open another app from xamarin forms app

$
0
0

From a xamarin forms app, when we click a button is it possible to open an app in power apps (with SSO also) ? Could anyone give me suggestions.


Refreshing Observable Collection Throws Exception

$
0
0

Hi,
I need help.
I am stucked in following situation.
In a viewModel(SchedulerViewModel) i have an ObservableCollection(AppointmentEventsCollection).
I have bind this ObservableCollection to a Scheduler (DataSource="{Binding AppointmentEventsCollection}")
Everything is working great.
Now i need to Fill this Observable Collection from a Service(SignalRService.cs).
Actually i need to refresh it with data i get from the server.
I tried thefollowing code but get an exception on AppointmentEventsCollection.

SchedulePage.xaml
...

...

SchedulerViewModel.cs
...
private ObservableCollection _AppointmentEventsCollection = new ObservableCollection();
private CustomAppointments appointmentEvents = new CustomAppointments();

    public ObservableCollection<CustomAppointments> AppointmentEventsCollection
    {
        get
        {
            return _AppointmentEventsCollection;
        }
        set
        {
            _AppointmentEventsCollection = value;
            OnPropertyChanged("AppointmentEventsCollection");
        }
    }

...
public SchedulerViewModel()
{
AppointmentEventsCollection = new ObservableCollection();

        GetAppointments(appointmentEvents);
    }

private async Task GetAppointments(CustomAppointments appointmentEvents)
{
...
FillObservable(tr);
}

private void FillObservable(List tr)
{

        foreach (var _appointmentEvent in tr)
        {
            ...
            AppointmentEventsCollection.Add(_appointmentEvent); <-- I get an exception here
        }
    }

public async Task UpdateAppointmentEventsCollection()
{

            var test = AppointmentEventsCollection.Count;   <--This is working
            AppointmentEventsCollection.Clear();        <-- I get an exception here
            await GetAppointments(appointmentEvents);


    }

SignalRServices.cs
...
private async Task OnMessageReceived(SignalRMessages message)
{
// This is woking
var test = SchedulerPage.schedulerviewModel.AppointmentEventsCollection.Count;
await SchedulerPage.schedulerviewModel.UpdateAppointmentEventsCollection();

    }

Thank you for any help providing

Binding source url video with plugin Global.Video Player

$
0
0

How can I make the url of my video that I have for binding come out in my view.

Do not put the static url, but bring the url record in a list, and the video appears playing.

And when I put the static link, if the video appears.
I am using a carouselView with an ObservableCollection

Crash using Crossmedia Plugin to upload image

$
0
0

Dear Experts,

I'm using the Crossmedia plugin to upload a photo from my device's gallery to a server. Everything works fine the first time, meaning I get the dialog asking for permission and the upload actually happens. However, the very next time i attempt to upload a photo, it crashes. I believe I have the correct keys set in info.pList but haven't quite found a reason for it...Has anyone experienced this before?

Many thanks in advance!

percy

Getting this error: cannot access ActivityCompatApi23

$
0
0

Hi guys,

It seems I made a post about it already but its not showing up in the questions page so I am posting it here again.

So I tried to install a PCL project/library for taking screenshots using nuget. After I installed it, my app stopped building, so I uninstalled the library and tried building it again but its not building anymore. I searched online one of the posts in the forums said that certain files may have gotten corrupted and the solution is to replace a few files in my C drive and I did that but it did not work. I also tried to repair xamarin/visual studio and also tried to replace those files with a local C drive backup which I have- none of these things worked.

The link to the post is here: forums.xamarin.com/discussion/47902/missing-classes-android-support-library

I can build my project as long as I don't rebuild it, which is fine for now, but I have to install a few more libraries like SQLite and such to get my app fully working as intended, and it seems that Xamarin/Visual Studio does not install any new libraries if the build fails. So please let me know if you guys know how to resolve this issue. Thanks in advance.

How to select some texts in a Label?

$
0
0

for example:

can I only select the words"is"?not all of the text.
and also can tell me the index of the selected texts?

Viewing all 77050 articles
Browse latest View live


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