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

How to change size of Rectangle by touch and drag created by SkiaSharp?

$
0
0

Hi everybody!
I use SkiaSharp to draw a Rectangle, I want to change size when touch and drag the corner of rectangle.
How to change size of Rectangle by touch and drag created by SkiaSharp?


Feedback to user: some like snackbar in android?

$
0
0

I search a method to give to user a feedback like snackbar in android for "Connection not present" or "Message sent succeffuly".
I see that snackbar for iOS exist but in Xamarin.iOs is not present, so I'm searching for a Crossplatform solution. There's any way?

How to record audio in Xamarin Forms for 15 seconds?

$
0
0

Hi Everyone,
I want to record audio for 15 seconds in Xamarin Forms and after 15 seconds the recording should stop. Please help me with this. Your help would be appreciated.

Get position and item number of list item

$
0
0

How can I get the ViewCells position on the screen and what number the ViewCell is in the ListView.

I am trying to set the color of every second cell to a light color and every other second cell to a darker color.
Then I am trying to change the color of the cells relative to where they are on the screen (in the list)

Any ideas how to do this?

Google Account login Integration for android Xamarin

$
0
0

I need to integrate google login to android application. gone through the code from bellow link:
http://motzcod.es/post/67077106339/google-plus-services-login-and-1-in-xamarin-android
it shows the error connection failed and [GooglePlayServicesUtil] Google Play Store is missing. even ofter adding google play service(Froyo) component.

even i gone through the bellow links
https://developers.google.com/+/mobile/android/sign-in
http://stackoverflow.com/questions/18706519/android-login-using-google-account
http://stackoverflow.com/questions/15266669/google-login-for-android-app

but this is related to android eclipse using java code. can anybody suggest me how to do this in xamarin. any hints/links are appreciated. thank you.

How to move a Map pin on android

$
0
0

Map pins are not moving by changing their lat, lon on android. Does anyone knows how to do it elegantly? How to call setposition android method on the pin?

How to change quantity of listview item on button click?

$
0
0

I have a listview with a item title label, a button and entry,when a user click on listview items button then it will increase the quantity of selected list item?

how to do this?

Tableview - disallow row selection

$
0
0

I have a tableview which I'm using for a settings page. This tableview contains a row with a switch. I would like to disable the selection of the row containing the switch, while keeping the switch (or other child controls) enabled. I'm hoping there is an easy way to accomplish this without custom code.

I've provided a couple of pictures for illustration. Please disregard the alignment of the switch control to the text. It will be fixed. Thanks.


Get nested Json

$
0
0

hi guys
I want to get nested json and use them in listview
this is my property class

 public class Items
    {
        public Image  image { get; set; }
        public Artist artist { get; set; }
    }


    public class Rootobject
    {
        public Tracks tracks { get; set; }
    }

    public class Tracks
    {
        public Track[] track { get; set; }
        public Attr attr { get; set; }
    }

    public class Attr
    {
        public string page { get; set; }
        public string perPage { get; set; }
        public string totalPages { get; set; }
        public string total { get; set; }
    }

    public class Track
    {
        public string name { get; set; }
        public string duration { get; set; }
        public string playcount { get; set; }
        public string listeners { get; set; }
        public string mbid { get; set; }
        public string url { get; set; }
        public Streamable streamable { get; set; }
        public Artist artist { get; set; }
        public Image[] image { get; set; }
    }

    public class Streamable
    {
        public string text { get; set; }
        public string fulltrack { get; set; }
    }



    public class Image
    {
        public string text { get; set; }
        public string size { get; set; }
    }

    public class Artist
    {
        public string name { get; set; }
        public string mbid { get; set; }
        public string url { get; set; }
    }

and this is my MainPage.cs
but this code is not working with nested json

private async void OnGetJson()
        {
            try
            {
                if (CrossConnectivity.Current.IsConnected)
                {

                    _activityIndicator.IsRunning = true;
                    var uri = new Uri("**************~~~~e7d9d6&format=json");
                    var client = new HttpClient();
                    var content = await client.GetStringAsync(uri);
                    string a = content.ToString();
                    var tr = JsonConvert.DeserializeObject<List<Items>>(a);
                    ObservableCollection<Items> ob = new ObservableCollection<Items>(tr);
                    lister.ItemsSource = ob;


                    int i = ob.Count;
                    if (i > 0)

                    {
                        _activityIndicator.IsRunning = false;
                    }
                    i = (ob.Count * heightRowsList);
                    _activityIndicator.HeightRequest = i;
                }
                else
                {
                    await DisplayAlert("Error", "No Connection", "Cancel");
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
        }

Can Anyone help?

Debug only Gesture

$
0
0

Does anyone have a suggestion on how to add a debug only gesture. Something accessible on any page.
I thought about adding something that would recognize a tap on the title. But that wouldn't work on modal pages.
Perhaps a double tap on the page. But it appears that isn't easy to do without adding a third party library.

We want to have a way, in Debug only, to bring up some info on the current page. So it is perfectly fine for it to be "hidden UI" and non intuitive.

How to remove previous page after pushing a modal page?

$
0
0

List Page -> Detail Page -> Edit Page (Modal page)

How can I remove detail page after pushing edit page modally? if I check Navigation.NavigationStack on OnAppearing method of edit page, it doesnt know anything about detail page because NavigationStack has only Edit Page but no List Page, no Detail Page? so what is the best way to achieve this?

Irregular Picker Autofit Behavior

$
0
0

I have multiple TableViews across multiple pages, each with a ViewCell that contains a StackLayout that contains a Label and a Picker:

<TableView Intent="Form" HasUnevenRows="True">
    <TableRoot>
        <TableSection>
            ...
            <ViewCell>
                <StackLayout Orientation="Horizontal" Padding="16,0">
                        <Label Text="Specification Mode" HorizontalOptions="Start" VerticalOptions="Center" MinimumWidthRequest="120" />
                        <Picker ItemsSource="{x:Static local:Data.someList}" HorizontalOptions="EndAndExpand" VerticalOptions="Center" />
                    </StackLayout>
                </ViewCell>
            ...
        </TableSection>
    </TableRoot>
</TableView>

Thing is, in some pages, the Picker will autofit the selected text (which is the desired behavior), but in some pages, it doesn't. By autofit I mean the size of the Picker increases/decreases to fit the selected text such that there is no white space or truncation.

Also, all the relevant settings are exactly the same (TableView HasUnevenRows, HorizontalOptions, etc.). The above XAML code includes all the properties that are consistent across the pages.

But of course, there has to be something that is different. So my question is, what else could be causing some Pickers to autofit and not others?

As a side note, I do have a workaround for those stubborn Pickers, that is to delete and then add it back with the SelectedIndexChanged event.

Padding in Button

$
0
0

I've searched and found similar questions but no real answers. I have a Button. When the button appears in iOS there is no padding around the text. Look at the button labeled "Forgot Password".

iOS Screenshot

When the button appears on Android there is padding around the text.

Android Screenshot

What is the correct way to deal with this?

Can someone give me advice for starting on a data table in xamarin forms?

$
0
0

I don't know what the best place to start for building a table in xamarin forms with rows and columns. Basically I'd want to implement something like a data grid/table with rows and columns and would have paging. Does anyone know the most efficient way to build such a thing? I currently have some hacky code that builds a grid in xamarin forms and just adds the children to the appropriate grid/column. I don't want to pay for something, I want to build it so I'd prefer to avoid telerik or devexpress :). Thanks in advance

How to add and use the .Net Framework to a project?

$
0
0

greetings I am new in visual studio and with Xamarin.forms I am trying to make a multiplatform app, the app requires that I use a nuget package but that package is 100% compatible with the .Net standard 2.0 that I am using so when compiling it gives me a series of warning and errors, I want to change to the .Net Framework 4.6.1 that my VS recommends but when I try to change I can not since it does not give me the option to select another .Net Framework attached an image where I highlight the problem and with the warning messages that I find after compiling, it seems strange to me since I have installed the .Net Framework from 3.5 to 4.7.1 but it does not give me the option to use them. Please help me with this problem if you can tell me how to use the different versions of the .Net Framework, I thank them and please can explain it to me in an easy way since as I mention I am new and it is costing me a lot to understand these things I appreciate it a lot.!


How can I display the very recent image from gallery as a thumbnail of gallery?

$
0
0

Hello, I'm now developing my own camera application. Today, I want to know how can I display recent image from gallery as a thumbnail of gallery. This words may be diffiult to understand for you guys. So I prepare example.

As you can see in the picture, left bottom side, there is some thumbnail image of gallery, and that thumbnail is equal to the recent taken picture. How can I implement this with XF? Or, is there any way to do it through native? If so, please enlighten me both iOS and Android please. Thank you in advance.

Switching ContentViews Xamarin.Forms

$
0
0

I am trying to create a custom navigation Bar. I have set up my Navigation Bar and called it NavBar, and added a ContentView above it containing the Current Displayed page. I have created a public variable containing the ContentView like so: public ContentView CurrentPage = new Featured(); and I have a StackLayout set up in the Page like so:

var stacklayout = new StackLayout { Spacing = 0 };
stacklayout.Children.Add(CurrentPage);
stacklayout.Children.Add(NavBar);
Content = stacklayout;

I have a function that is called when a button on my NavBar is pressed to change the value of CurrentPage, set up like this:

void NavToBuy(object sender, EventArgs e)
    {
        CurrentPage = new Buy();
    }

But when the button is pressed, nothing happens. I think that the value is being changed, but not displayed on the screen. Is there any way to fix this? Thanks for any help in advance :)

UITest doesn't affect code coverage

$
0
0

We are working on a Xamarin.Forms project and trying to improve our code coverage. Until recently, we only wrote unit tests for our model, which leaves tons of view pages untested. We are trying to use UITest to test these pages, but it doesn't work. When I run "analysis code coverage" from VS2017, the view pages tested by UITest still get 0% covered. Anyone knows how to fix that or any idea about how to test the view page to improve the code coverage? Thanks!

Modern UWP Controls

$
0
0

Is there any plans to make some of the UWP controls more complete/modern? At the moment my main concern is the Table View, I might as well be in an RTM Windows 8 app, even forces the string to lower, its just plain ugly in a Windows 10 app! Also the Text and Entry cells have no padding at all, while the iOS and Android ones do, I can't add margins to ListViews/TableViews as it ruins the iOS and Android experience (going to look into custom cell renders).

A lot less important but worth noting, while this isn't actually either an incomplete or old control, is the command bar only allowing the text of icons beneath the icon instead of too the side, I feel this may be asking too much of Xamarin.Forms and should perhaps look at custom renderers again I have also thought of using this, adding a 'TextToSide' property and making the UWP renderer.

Just want to know if there is anything out there to help with the problem before I go making custom renderers.

xamarin forms map is not showing

$
0
0

like upper image xamarin map is not showing.

i already access android permission.

how can i solve this problem?

Viewing all 58056 articles
Browse latest View live


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