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

Any one completed voice call using Twilio library in Xamarin ??

$
0
0

I'm facing an issue in this ConnectionOption function. I'm not able to find it in the Twilio library. So, please help me to find out the solution. It's urgent.


Issue with SwipeView and Listview

$
0
0

I only want to display the TopItems (Swipe down) if my ListView is also on top position "1". I would like to implement my own "Pull to Refresh" functionality, but the function is also active when I just scroll up (by Swiping down).
Any Ideas ?

does anyone know if microsoft has plans to create a drag and drop toolbox for xamarin forms ??

$
0
0

does anyone know if microsoft has plans to create a drag and drop toolbox for xamarin forms ??

Xamarin forms: Webview video auto pausing is not working

$
0
0

I am using a webview for playing the video. I need to pause it programmatically in certain situations. For this, I am using the following code but which is not working.

My code:

string pausefunctionString = @"var videos = document.querySelectorAll('video');  
                        [].forEach.call(videos, function(video) { video.pause(); });
                        ";
web_view.Eval(pausefunctionString);

I got the above solution from this thread.

I am using HTML data as the content of webview:

Webview code:

string htmlData = "htmldata";
var htmlSource = new HtmlWebViewSource();
htmlSource.Html = htmlData;
advanced_web_view.Source = htmlSource;

I have uploaded a sample here.

Video is not auto pausing in android and windows.

Is it possible to send notification on button click without using Firebase or third party in Forms?

$
0
0

Hi All,
I hope you all are well. I want to ask a question.
Is it possible to send notification on button click without using Firebase or a third party in Xamarin.Forms? I want to make service for notification. If anyone have any idea please suggest me.

Adview Problem

Native to Xamarin.forms Navigation For UWP

$
0
0

Is it possible to navigate from Native UWP page to Xamarin.forms NavigationPage. Basically I need to have startpage as Native UWP page with NavigationView and from each NavigationViewItem i need to define a navigation to the xamarin.forms navigationpage.
If this is not possible, what is the best way to use a NavigationView in a contentpage. Native embedding doesnt work for NavigationView.

Send json string including Group column

$
0
0

As i read in documentation i need to create a structure as follow, for having a group column in my listview.

 public class Group : List<Body>
    {
        public string Title { get; set; }
        public Group(string title)
        {
            Title = title;
        }
    }
    public class Body
    {
       public string Name { get; set; }
    }

 private void Button_Clicked(object sender, EventArgs e)
    {
        var items = new List<Group> {
            new Group("Title")
            {
                new Body { Name = "Dimitris" } }
        };
        var jsonstring = JsonConvert.SerializeObject(items);

    }

The problem is that when i am serialize this list, then my result is:

 [[{"Name":"Dimitris"}]]

It doesn't include Group Column. Is there any way which i can fix that? Or i must send from server a single list, and then to create a structure as above in my client's pc?

Example

var items=JsonConvert.DeserializeObject<List<Body>>(jsonstring);
foreach(var item in Items)
{
       var newItems = new List<Group> {
            new Group(item.Title)
            {
                new Body { Name = item.Name } }
        };
 }

Apple rejected my Xamarin.Forms iOS App for usage of non-public API which I don't use

$
0
0

I have an App that is under development using Xamarin. Forms and I have submitted more than 40 beta until now and it works fine, randomly in the last week I have started getting rejected from App with the following error

The app references non-public selectors in Appname.iOS: addTemporaryAttribute:value:forCharacterRange:, addTemporaryAttributes:forCharacterRange:, behaviorWithType:, defaultBaselineOffsetForFont:, defaultLineHeightForFont:, finished, greekingThreshold, horizontalCornerRadius, initWithSource:convolutionState:weights:, initWithType:, postSession:didAddPlayer:, postSession:didReceiveData:fromPlayer:, postSession:didReceiveMessage:withData:fromPlayer:, postSession:didRemovePlayer:, postSession:player:didChangeConnectionState:, postSession:player:didSaveData:, preferredMetalContext, removeData:, removeTemporaryAttribute:forCharacterRange:, setGreekingThreshold:, setHorizontalCornerRadius:, setIsPrimary:, setShouldAntiAlias:, setUUID:, setVerticalCornerRadius:, shouldAntiAlias, temporaryAttribute:atCharacterIndex:effectiveRange:, temporaryAttribute:atCharacterIndex:longestEffectiveRange:inRange:, temporaryAttributesAtCharacterIndex:effectiveRange:, temporaryAttributesAtCharacterIndex:longestEffectiveRange:inRange:, textContainerChangedTextView:, toolTip, usesBackgroundSession, verticalCornerRadius

Also, I have seen a lot of issues since the last VS2019 for mac 2 weeks ago

I have found that several ppl got the same issue as the ones here, but neither solution solved my issue
Which I don't and don't understand the problem, I have already submitted an email without a reply until now, does anyone encounter the same issue?

WebView Header User-Agent

$
0
0

I want to open webpages with desktop mode. So, i need to set user-agent. I could not found useful anything on Google.

how to make background blurry for a view?

$
0
0

is it possible to make blurred effect on grid or stacklayout or frame? i have a view using absolutelayout as below. So basically Grid is overlapping listview with transparent background but I want this background to blurry or not 100% visible. I couldnt achieve that using different BackgroundColor tones of black and transparency. I couldnt achieve using Opacity. Anyone know if it is even possible?

     <AbsoluteLayout  VerticalOptions="FillAndExpand">

                    <ListView    BackgroundColor="White" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand"

                    </ListView>

                    <Grid BackgroundColor="#80000000" InputTransparent="False"  AbsoluteLayout.LayoutFlags="All" AbsoluteLayout.LayoutBounds="0,0,1,1"  >
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*"/>
                            <RowDefinition Height="*"/>
                        </Grid.RowDefinitions>

                        <Label Text="sometext" Grid.Row="1" TextColor="White" HorizontalOptions="Center" FontAttributes="Bold"   />

                    </Grid>
                </AbsoluteLayout>

Add left padding to entry

$
0
0

Is there an easy way to add padding to the left on an entry so the text doesn't start right up against the edge? I know I could do a boxview or something and hack it to make it be similar, but I feel like there has to be an easier way since it's a very common thing to do.

Sqlite.Net db file not creating

$
0
0

In my project am using sqlite its working fine in debug mode when coming to release mode its not working. In release mode db file not creating.

    public static void GetDBFile(string dbPath, ISQLitePlatform sqlitePlatform)
    {
        if (dbUtils == null)
        {
            dbUtils = new DataAccess(sqlitePlatform, dbPath);
        }
    }

I written like this in App.xaml.cs file calling this method in Mainactivity.cs ( Android project )

        dbPath = FileAccessHelper.GetLocalFilePath("dbfilename.sqlite");
    App.GetDBFile(dbPath, new SQLitePlatformAndroidN());

Is it possible and/or advisable to restart an App from code behind on Button selection?

$
0
0

I have a data collecttion type of App.
On a 'create new' button, is it possible and/or advisable to restart an App from code behind on Button selection?

On 'restart' its a completely new refresh with no need for any information or settings from previous entries.

My default approach is to reset the Form Controls 1 by 1. It's a tad tedious.

Many thanks
Stew

get value from SecureStorage.GetAsync() in xaml Style -> Setter

$
0
0

Hi,

I've stored an username using SecureStorage.SetAsync("username", ""); and I want to display this username to the bar at the top of the screen.
I'm using the Style property in App.xaml to save the styles that I want for my pages and I'm trying to figure out how to set the property "Title" to SecureStorage.SetAsync("username", "");

App.xaml:

MainPage.xaml:

I tried it using C#, but that didn't display anything.

Does anyone know how to do this?

Regards, Ganesh


Display placeholder image when image does not load of UriImageSource

$
0
0

Hi

I am using a remote uri as a source for an Image in Xamarin forms using a UriImageSource. I want to display a placeholder image/control when the remote image does not exist, but cant find a nice way to do this. I thought IsLoading might be the one but this is set to false once it succeeds or fails to load the image, do I have test if the remote image exists, seems a little over kill making another Http request just to determine if it doesn't exists and show a placeholder?

thanks

Best way to handle bookings?

$
0
0

I am currently making an app to handle job bookings for a company. I have an Azure SQL with all user info and job site info. What is the best way to create a job booking? I would like the client and myself to receive an email with the details of the booking, as well as have the details be available within the app itself. I'd like to hear from someone who has done something similar before, what did you do to accomplish this?

Image Not Show Https Android 4,3,5,2

css performance

$
0
0
is there any performance impact using css as style ? Runtime performance and build performance. How does css work with xamarin? Is it convert into xaml styles on build time? So it doesn't affect runtime performance or otherway around?

How to insert XML into sqlite table?

$
0
0

Hello, I need to insert an xml in a table created in sqlite, this xml is 122 MB in size, but I don't know if I am doing it the right way, so far I have tried it this way, but it gives me an error. I also wish I could use a progress bar to know the insert process. Thank you!...

  async Task InsertaColores()
    {
        string rutaXml = Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.LocalApplicationData), "C_XmlColores.xml");
        if (File.Exists(rutaXml))
        {
            XmlDocument xmlDoc = new XmlDocument();
            xmlDoc.Load(rutaXml);
            DataSet dsc = new DataSet();

            using (XmlNodeReader xnr = new XmlNodeReader(xmlDoc))
            {
                dsc.ReadXml(xnr);
            }

            DataTable dtc = dsc.Tables["XMLCOLORS"];                

            int cuentaFilasc = dtc.Rows.Count;

            _conn.CreateTable<tblColores>();               

            foreach (DataRow dr in dt.Rows)
            {
                try
                {
                    var color_id = dr["COLORS_ID"].ToString();
                    var color = dr["COLOR"].ToString();

                    tblColores tbl = new tblColores();
                    tbl.Color_Id = Convert.ToInt32(color_id);
                    tbl.Color = Convert.ToString(color);
                    _conn.Insert(tbl);
                }
                catch (SQLiteException ex)
                {
                    await DisplayAlert("Error", ex.Message, "Ok");
                    btnInsertarArticulos.IsEnabled = true;
                }
            }


            File.Delete(rutaXml);

            await DisplayAlert("Mensaje", "Se han insertado nuevos colores.", "Ok");
            //btnInsertarArticulos.IsEnabled = true;
        }
        else
        {
            await DisplayAlert("Mensaje", "El archivo xml con los colores no existe.", "Ok");
            btnInsertarArticulos.IsEnabled = true;
        }
    }
Viewing all 77050 articles
Browse latest View live