Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all 204402 articles
Browse latest View live

Scrollview works with slight problem

$
0
0

I have a pop-up working just fine but the problem occurs when the keyboard is present on the screen. Attached are my screenshots of what is happening and I am unsure of how to solve it. The popup window goes behind MGMT Notes/Detail Notes/Postmortem. I am unsure of how it to remain on top of the layer.

Would you need to see the code of the Main Detail page or the popup?


Access Field Value of Raw View in a C# ObservableCollection

$
0
0

I am writing to ask how best to access a value Heading in Raw View section of below C# ObservableCollection cBeanList;

Please see attached screen shot of debug mode for additional details of existing ObservableCollection layout;

public static ObservableCollection cBeanList = new ObservableCollection();

Type SingleBeanGroup is specified as follows: public class SingleBeanGroup : List, INotifyPropertyChanged

  • and contains public string Heading { get; set; }

Type SingleBean is simply a class with values of string and bool :

public class SingleBean
{
public string Field1 { get; set; }

    public bool Selected { get; set; }

    public SingleBean()
    {
    }

}

Following code snippet works well to access Field1 - which is selected by user, via a Xaml page Check Box:

foreach (var data in MonkeysViewModel.cBeanList)
{
for (int i = 0; i < data.Count; i++)
{
if (data[i].Selected == true)
{
await DisplayAlert("Alert", "Model Tapped: " + data[i].Field1, "OK");
}
}
}

Thanks in advance for any insight, guidance;

Arrrgh, VS Update bites again!

$
0
0

Hi, I just updated my Visual Studio 2019 to the latest and it messed up my project. (This happens at least 50% of the time but usually to the iOS project)
Now my project is showing tons of these errors:
The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?)

and all the references show a yellow flag.

Does anyone know how to fix this? Re-adding the reference does not work.

My other projects in the same solution like iOS are fine.

Xamarin.Auth sign in displays wrong app name

$
0
0

When I use Xamarin.Auth to sign in it displays the wrong app name:
Choose Account to sign in to (a wrong app name displayed here instead of the app's name)

The Google Drive API key is set up for the correct package name. There was a sample that I setup a client key for back in 2017 with the name that is getting displayed. I'm wondering if I need to create another Google Drive API key? Anyone else running into this? The app is correctly uploading and downloading files from Google Drive it's just that the name is wrong for the sign in prompt (which might freak users out).

How to keep VS 2019 and VS for Mac up to date with latest stable?

$
0
0

For years I've just used the Mac and know that's easy to just keep up to date with the latest stable. Now I'm moving my apps to Xamarin Forms and enjoying VS 2019 for my IDE. I have a new Mac Mini I'm using as the paired mac. I'm confused about how to keep things up to date. I can connect in to the Mac Mini and open VS for Mac and update to latest stables but then VS 2019 says there is a Mono mismatch and to install a different version on the Mac Mini.

What is the best practice that I should be following to ensure I always have the latest Xamarin stable when using VS 2019? What do I need to keep updated and where? It's very confusing to have these differences between Windows and macOS.

Xamarin iOS Login fails over Wifi for some devices works over cellular

$
0
0

I have an issue where if you try and login over wifi the login fails using HttpClient but it works over cellular. It doesn't happen on all wifi networks. Anyone else seen this behavior

"Collection was modified" when updating dynamic resources

$
0
0

Hi all,

So here's the background: to support accessibility, we'd like to make our app responsive to text size changes set in the system preferences. We don't like to use named font-sizes, as there's too much difference between the styles used on Android and iOS, which would affect the look of our app. The solution we came up with is to define our own "named font sizes" - i.e. application-level resources of type Double that are then applied throughout the app as dynamic resources. When then use the same the technique Xamarin Forms uses internally to determine a scale factor: always 1 for Android (this OS solves the issue itself, and the scale factor vis-à-vis the current preferred body size on iOS (i.e. UIFont.PreferredBody.PointSize / 17). With that, we update the aforementioned resources, and the result is our app can respond to dynamic font sizing.

This all works a charm on Android, as it does on iOS when running the scaling in the App's constructor. However, to make our app more responsive and dynamically apply these changes when the app is resumed, we'd like to call the same font scaling code OnResume. This is where the problems start.

When we try to update the dynamic resource font sizes OnResume, the app crashes with a System.InvalidOperationException "Collection was modified; enumeration operation may not execute." This only happens on iOS, only on iOS 13, only OnResume, and only for certain resources (these resources are on the page being shown, but other resources on the same page do not experience the issue). The exception occurs when trying the following line of code:

Current.Resources[fontName] = storedFontSize * scalingFactor;

What seems to happen is that this dynamic resource change triggers further changes to other resources, which cause the resource-collection being updated to change, so that any subsequent (or is that concurrent??!?) updates to the same resource-collection will fail.

Seeing as our code is proprietary, I can't share, unfortunately, but: any ideas?

Thanks for your help!

The specified executable is not a valid application for this OS platform

$
0
0

The problem in VS2019 appears when deploying to a real device. On another machine with the same VS configuration and the same Android device, there are no problems. Someone faced?


SkiaSharp PNG Header

$
0
0

Hi,

Apologies if this seems a bit vague!

I can create an image in SkiaSharp and save it as a PNG file. This is only saved at 96 dpi, but having looked into PNG header files, I know I can change values in the header to make it 200dpi - this is important as the image is printed on a thermal printer, and 96dpi means the print is pixelated.

The problem I have (this is the vague bit, need more research) is the PNG header has sBit in it, whereas practising editing the header contains sRPG in the header. If I open the image in say Paint.NET and save it, the header changes from sBit to sRPG.

So my question is how can I change the dpi of the PNG when the header file contains sBit in it? This is my last stumbling block in my project, and am rather lost with it!!

Many thanks

VS2019 16.6.0 xamllanguagepackage package did not load correctly

$
0
0

I started receiving this message "xamllanguagepackage package did not load correctly" and now my XAML docs for xamarin don't display with intellesense or formatting. Just appears as raw text with no colors.

I've repaired, then uninstalled VS2019 completely and reinstalled, but still getting the message.

Any advice?
Brent

How do I reference one XAML MergedDictionary from another?

$
0
0

I am struggling with XAML Merged Dictionaries. Is it possible to get something like the following working?

File Colours.xaml contains this:

<?xml version="1.0" encoding="utf-8" ?>
<?xaml-comp compile="true" ?>
<ResourceDictionary xmlns="http://xamarin.com/schemas/2014/forms"
                    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml">

    <Color x:Key="WarningTextColour">#FF0000</Color>

</ResourceDictionary>

Another file Text.xaml contains something like this:

<?xml version="1.0" encoding="utf-8" ?>
<?xaml-comp compile="true" ?>
<ResourceDictionary xmlns="http://xamarin.com/schemas/2014/forms"
                    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml">
    <Style x:Key="WarningTextStyle" TargetType="Label">
        <Setter Property="TextColor" Value="{StaticResource WarningTextColour}"/>
        <Setter Property="FontSize" Value="Large"/>
    </Style>
</ResourceDictionary>

Then somewhere like my main App.xaml file, I bring them together like this:

<Application xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="myProject.Forms.App">

    <Application.Resources>
        <ResourceDictionary Source="Styles/Colours.xaml"/>
        <ResourceDictionary Source="Styles/Text.xaml"/>
    </Application.Resources>

</Application>

I've read the guides and tried various combinations of syntax, trying both the old and the new ways, but I can't find a way to do this. I am beginning to wonder if I am maybe approaching this completely the wrong way.

Even with all my XAML set to compile, the project builds okay (which is disappointing if I have something wrong), but the MainPage.xaml that tries to use the WarningTextStyle gives an exception.

Any help or advice would be very much appreciated.

Kind wishes ~ Patrick

Extremely long build with xamarin forms android

$
0
0

Hi,

I have a xamarin forms project with Xamarin.Forms v4.5 with Vs 2019.

And I compile with using Android 10.0 Q.

When I build in debug mode it's extremely long.

In my output it hangs 10 minutes on the line:

1>------ Build started: Project: Dev.Mobile.Android, Configuration: Debug Any CPU ------

Once it passes this step it's quite fast.

My setup for the build is:

What could bhe the issue? How can I investigate?

Thanks,

How to get voice overs on tiktok in 2020 ?

$
0
0

I just installed the tiktok application today, let me ask how to get voice overs on tiktok? Has anyone tried it yet, please give me a suggestion.

Xamarin Forms... MVVM and Observable Collection Issue (perhaps)

$
0
0

I have built a prototype Forms App for Android. It's a potential replacement for a WebForms app. The concept is, I begin with a JSON file (as a datasource) for local non-internet functionality. This is a READ-ONLY file, from the users perspective... The data is retrieved and updated as needed from a web service... (the url is contained within each JSON Entity... When the app opens, there is default JSON information the app can start with... Then, there is a date field and some ModelView logic that retrieves new data as needed, and is updated in the "live" entity (that which was loaded initially). When the app Sleeps or Stops the current ObservableCollection is serialized to JSON, with any subsequent data changes and the file itself is saved...

Everything works as expected... Except... In the json file there are approximately 7 primary entities. Only 4 of them require regular updates because they have hot changing information... This I wish to display in a subset on the startup Navigation page in a marquee... I have all the bits in place and it all works, BUT only when the full list is queried...

ModelView (psuedo code)

PrimaryList = new ObservableCollection(FileOperastions.GetFullPrimaryLIst());

// GetFullPrimaryList returns a "list of primary model" items. I then bind this list to the binding context of the view, add it to the CarouselView in Xamarin and Walla! It works... As the background code on the primary thread executes, the Observable entities are updated from the URLs in the entity, and the displays are changed, viewable and subsequently saved... Perfect!

The problem appears to happen when I use a select query for only the 4 primary items that require notification... So;

PrimaryList = new ObservableCollection(FileOperastions.GetFullPrimaryLIst().Where(l => l.infourl.Contains("http")).ToList());

  • My list now contains just the 4 entities in question as desired.
  • The CarouselView displays these 4 entities as desired, and SOME of the entities show updates while others do not.
  • Breakpoints in the WebClient DownloadStringAsync callback verify that the data is properly retrieved and the entity is updated properly...
  • But, the data is not shown, as it is when the full list is in place...

has anyone else run into this issue? Do I need to raise a CollectionChanged event here... It's odd it does not work for a subset, but works for the full list... In terms of code... I change NOTHING else other than the line of code displayed above... I have tried creating a separate function of course, but whether it is a linq query as above or a function that returns a NEW list makes no difference... the result is the same... however, this also breaks the MVVM construct I am trying to stay within...

Where Do I Find Android Emulator?

$
0
0

I am setting up Visual Studio for the first time and when I start the Android Device Manager it doesn't show any devices. When I click on Add Device it only shows a few Pixel phones and various other emulators but not for my phone Verizon ( LGV40 ThinQ ). I tried this several years ago with an older phone and I seem to recall that I went to Verizon to get it. (I could be wrong). I just checked with Verizon chat and they said that they didn't have the emulators.

Where would I find my emulator? Thank you.


How take out watermark in kinemaster for free?

$
0
0

Yesterday I installed the kinemaster app, how take out watermark in kinemaster for free? Please help me, thank you everyone.

How do I set the app icon shown in app switcher in Android Pie?

$
0
0

I have my app's icon properly set up so it shows in Android launcher, but if I tap the square button to switch apps then the icon shown above the image of my app is a default Android icon with a blue background. How can I set this icon?

image

What do these static linking errors in Xamarion.iOS mean

$
0
0

I have searched the internet before I posted this question. But I haven't been able to resolve the native linking errors in Xamariin.iOS.

I have set the required frameworks using Frameworks attribute, SamrtLink=true, ForeLoad=true, IsCxx=true. I also tried LinkerFlags="-lc++" and LinkerFlags="-lstdc++" and found no difference to my static linking errors below.

MTOUCH: Error MT5210: Native linking failed, undefined symbol: std::string::_Rep::_M_destroy(std::allocator const&). Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.

and also other similar symbols: std::string::assign(char const*, unsigned long) std::basic_string, std::allocator >::basic_string(char const*, std::allocator const&) std::basic_string, std::allocator >::basic_string(std::string const&)

The final errors:

MTOUCH: Warning MT5215: References to 'System' might require additional -framework=XXX or -lXXX instructions to the native linker (MT5215)

Error MT5201: Native linking failed. Please review the build log and the user flags provided to gcc: -ObjC (MT5201)

MTOUCH: Error MT5202: Native linking failed. Please review the build log. (MT5202)

clang: Error: linker command failed with exit code 1 (use -v to see invocation)

Thanks for your help.

Java.Lang.IllegalStateException: FragmentManager is already executing transactions

$
0
0

I want to add a TabbedPage as a child of another TabbedPage, it works fine for me, but when I press the back button the application throws me an exception: Java.Lang.IllegalStateException: 'FragmentManager is already executing transactions'

Best way to store string based on OS and version

$
0
0

Hi all,
whats the best way to store a string (in my case Google AdMob Id) based on version (Debug or Release) and OS (iOS or Android)? So I have 4 different values. I tried with "if DEBUG" or "On Platform" but did not find the best result yet. I think I'd prefer to store all the values in App.xaml but did not get it to work with all these combinations (Debug/Release and iOS/Android).
Many Thanks!

Viewing all 204402 articles
Browse latest View live


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