Is there any way to either decrease the font size or increase the window size of the picker's popup window?
I have some long text that's cutoff when making a selection.
Is there any way to either decrease the font size or increase the window size of the picker's popup window?
I have some long text that's cutoff when making a selection.
I want that the menu from iOS to look like the one on the Android...
I think I need to write this, but what there?
public partial class MainPage : MasterDetailPage
{
public MainPage()
{
InitializeComponent();
switch(Device.RuntimePlatform)
{
case Device.iOS:
MasterBehavior = ********************;
break;
case Device.Android:
MasterBehavior = MasterBehavior.Popover;
break;
}
InitializeAsync().ConfigureAwait(false);
}
}
Hi
I'm trying to use custom auth taken from the wonderful book written by adrian hall
https://adrianhall.github.io/develop-mobile-apps-with-csharp-and-azure/chapter2/custom/
But I'm in trouble with the next code in IHttpActionResult Post([FromBody] User body)
.....
System.IdentityModel.Tokens.Jwt.JwtSecurityToken token = Microsoft.Azure.Mobile.Server.Login.AppServiceLoginHandler.CreateToken(
.....
I get an error "Reference to type JwtSecurityToken claims is defined in 'System.IdentityModel.Tokens.Jwt,, but it could not be found"
If I downgrade the nget System.IdentityModel.Tokens.Jwtback to 4.0.20622.1351 I can solve: but how can I solve if I want use the vers. 5.0 ??
Tnx
Hello
I am beginner Xamarin but I practice C # windowsforms for years
I installed only what connects Android 7.1 but I get this error
The $(TargetFrameworkVersion) for FormsViewGroup.dll (vv8.0) is greater than the $(TargetFrameworkVersion) for your project (v7.1). You need to increase the $(TargetFrameworkVersion) for your project.
The version 8 does not interest me I wish the version 7.1 as well on the emulator as on live player
My problem is that I can not find a trace of the v8 in the configuration of my project
How can I configure my project on version 7.1?
thanks in advance
I have an ASMX service. Proxy class uses SoapHttpClientProtocol Invoke()
.
The first request from my app is very slow (0.5-2 minutes). The next requests are fast (1 second). This is regardless of HTTPS or HTTP.
A packet sniffer shows that it takes 17 seconds from I call the first request, until my app sends the first packet.
Output window:
03-23 10:28:50.018 D/Mono ( 2358): Image addref Mono.Security[0xd1221ba0] -> Mono.Security.dll[0xd126ff00]: 2
03-23 10:28:50.018 D/Mono ( 2358): Prepared to set up assembly 'Mono.Security' (Mono.Security.dll)
03-23 10:28:50.018 D/Mono ( 2358): Assembly Mono.Security[0xd1221ba0] added to domain RootDomain, ref_count=1
03-23 10:28:50.019 D/Mono ( 2358): AOT: image 'Mono.Security.dll.so' not found: dlopen failed: library "/data/app/com.example.MyApp-1/lib/x86/libaot-Mono.Security.dll.so" not found
03-23 10:28:50.019 D/Mono ( 2358): AOT: image '/usr/local/lib/mono/aot-cache/x86/Mono.Security.dll.so' not found: dlopen failed: library "/data/app/com.example.MyApp-1/lib/x86/libaot-Mono.Security.dll.so" not found
03-23 10:28:50.020 D/Mono ( 2358): Config attempting to parse: 'Mono.Security.dll.config'.
03-23 10:28:50.020 D/Mono ( 2358): Config attempting to parse: '/usr/local/etc/mono/assemblies/Mono.Security/Mono.Security.config'.
03-23 10:28:50.020 D/Mono ( 2358): Assembly Ref addref System[0xe577af80] -> Mono.Security[0xd1221ba0]: 2
Loaded assembly: Mono.Security.dll [External]
03-23 10:28:50.020 D/Mono ( 2358): Assembly Ref addref Mono.Security[0xd1221ba0] -> mscorlib[0xea20a340]: 52
03-23 10:28:50.036 D/Mono ( 2358): Assembly Ref addref Mono.Android[0xe5779780] -> System[0xe577af80]: 14
By the way, when I use HttpWebRequest
and manually write SOAP envelope and parse XML it is much faster even the first time (2-3 seconds). But much more work to maintain, so I rather not use this method.
Hi,
I try to right align text under Label but can't find how do this. I try to make 3 label like this :
Label 1 | Label 2 | Label 3
Here is my layout
<?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="BasicForm.MainPage">
<ContentPage.Content >
<StackLayout Spacing = "0" Padding="10, 40, 10, 40" BackgroundColor="Green" Orientation="Horizontal" HorizontalOptions="FillAndExpand" VerticalOptions="Start">
<Label x:Name="start" Font="Large" Text="t" HorizontalOptions="FillAndExpand" VerticalOptions="Center"></Label>
<Label x:Name="middle" Font="Large" TextColor="Red" Text="e" HorizontalOptions="Center" VerticalOptions="Center"></Label>
<Label x:Name="end" Font="Large" Text="st" HorizontalOptions="FillAndExpand" VerticalOptions="Center"></Label>
</StackLayout>
</ContentPage.Content>
</ContentPage>
Label 2 contain only one letter so it have to be on center of the screen. Label 1 is the start of the word (align right) and Label 3 the end of the word.
I have a complex page layout that involves a Grid into which I dynamically insert other Layouts/Views. On iOS and Android, this works fine, but on UWP I hit a problem when inserting an Entry (nested in a ScrollView) that is bound to a non-Empty string. In that situation, the height of the Entry does not take into account the FontSize of the text in the Entry.
I've simplified the code down to the following, where an instance of BugUWPEntryBindingPageView gets pushed onto the navigation stack.
If the Entry is bound to ValueOne (initially a non-empty string) the height of the Entry is incorrect when the Entry is added to the Grid.
If the Entry is bound to ValueTwo (initially an empty string) the height of the Entry is correct.
This looks like a Xamarin.Forms bug to me (I'm using XF 2.4.0), but (other than always starting with an empty string and later setting the correct value in the ViewModel) has anybody got any ideas for a workaround? (I don't want to wait for Xamarin to release a fix before getting this particular page working as expected)
using Xamarin.Forms;
namespace ViewsUsingXamarinForms
{
public class BugUWPEntryBindingViewModel
{
public BugUWPEntryBindingViewModel()
{
ValueTwo = string.Empty;
ValueOne = "123";
}
public string ValueOne { get; set; }
public string ValueTwo { get; set; }
} // public class BugUWPEntryBindingViewModel
public class BugUWPEntryBindingPageView : ContentPage
{
private static readonly BugUWPEntryBindingViewModel ViewModel = new BugUWPEntryBindingViewModel();
private Grid _grid;
protected override void OnAppearing()
{
_grid = new Grid
{
BackgroundColor = Color.White,
HorizontalOptions = LayoutOptions.Fill,
VerticalOptions = LayoutOptions.FillAndExpand,
ColumnDefinitions = new ColumnDefinitionCollection
{
new ColumnDefinition { Width = GridLength.Star },
},
RowDefinitions = new RowDefinitionCollection
{
new RowDefinition {Height = GridLength.Auto },
new RowDefinition {Height = GridLength.Star }
},
};
_grid.Children.Add(
new Button
{
Text = "Add/replace entries",
BackgroundColor = Color.Blue,
TextColor = Color.White,
Command = new Command(OnAddEntries)
}, 0, 1, 0, 1);
BindingContext = ViewModel;
Content = _grid;
}
private void OnAddEntries()
{
Entry entry = new Entry
{
FontFamily = "Verdana", //DeviceWrapper.DefaultFontFamily,
FontSize = Device.GetNamedSize(NamedSize.Medium, typeof(Entry)),
};
entry.SetBinding(
Entry.TextProperty,
new Binding(
nameof(BugUWPEntryBindingViewModel.ValueOne),
BindingMode.TwoWay,
null,
string.Empty));
_grid.Children.Add(
new ScrollView
{
Content = new StackLayout
{
Children =
{
entry
}
}
}, 0, 1, 1, 2);
}
}
}
Hello there! So what I'm trying to accomplish is the following: I have a scrollview with a stack layout inside it, and I'd like to create multiple absolute layouts which each wrap around a group of elements, which would then be added into the stack layout. For the sake of clarification consider something like Instagram's homepage, where you have Posts composed of an Image, the User's Name on top of It, and the comments section beneath it. Ideally, I'd like to create those "post" objects and have them wrapped inside an absolute layout, which in turn would be stacked inside a stacklayout, which would be scrollable (inside a scroll view). Now, I'm not sure if the way I'm implementing it is the best way to do so, but any help would be appreciated.
Code looks something like this
`
<StackLayout x:Name="StackLayout_Container"
HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand"
Spacing="10"
Padding="5"
></StackLayout>
</ScrollView>`
I then create CardObjects as needed with each containing its own absolute layout, and later have them added to the StackLayout. This works, but for some reason the views inside the absolutelayout (images, labels ..etc) end up being too small and aren't positioned correctly, and the scrollview isn't scrollable. Any help is appreciated
I have a ContentPage, with a ScrollView that has a StackLayout with a couple of nested StackLayouts.
Essentially:
public class Widgets : ContentPage
{
StackLayout layout;
public Widgets()
{
layout = new StackLayout()
{
VerticalOptions = LayoutOptions.FillAndExpand,
Orientation = StackOrientation.Vertical
};
var Widget = new Wiget();
layout.Children.Add(Widget.Render());
//Widget.Render() returns a StackLayout with some other UI elements, it also loads some items from the web and adds them to the stacklayout.
var Widget2 = new Wiget2(); //Same idea...
layout.Children.Add(Widget2.Render());
Content = new ScrollView()
{
HorizontalOptions = LayoutOptions.FillAndExpand,
VerticalOptions = LayoutOptions.FillAndExpand,
Content = layout
};
}
}
When the Widget class finishes loading the web items, and adds them to the stacklayout, the new elements are not rendered, in fact any change to the UI does not get rendered. The widgets display a Loading icon while the items are loading, this is displayed properly and the loading icon disappears when loading is complete, but the new elements do not show up.
This appears this when running on Android, the ScrollView and related Widget elements work properly on iOS. Admittedly I can only try Android on the emulator so not sure if it is an issue with it. I am using the built-in Android_Accelerated_Nougat with API version 25. (7.1.1)
I have a binding library that works fine in a Xamarin iOS project, but if I try to use it in a Xamarin Forms project, the application crashes with a SIGSEGV every time as soon as the library is accessed.
Are there any special concerns to take into account when using a binding library with a Forms app?
I'm trying to set different text size, for each different platform & form factor in the application wide ResourceDictionary
<OnPlatform x:Key="myfontsize-phone" x:TypeArguments="x:Double" iOS="20" Android="20" WinPhone="30"/> <OnPlatform x:Key="myfontsize-tablet" x:TypeArguments="x:Double" iOS="40" Android="40" WinPhone="60"/> ... <OnIdiom x:Key="myfontsize" x:TypeArguments="x:Double" Phone="{StaticResource myfontsize-phone}" Tablet="{StaticResource myfontsize-tablet}"/>
and in my page XAML, i just call it with
<Label Text="SomeText" FontSize="{StaticResource myfontsize}"/>
The code above compile alright, but on run time I encountered with "System.InvalidCastException: Specified cast is not valid" in my page's InitializeComponent(). If I take out the reference to the and reference to the item instead, it will work alright.
This is what I get in the debug log, which isn't much help
09-01 20:56:01.292 E/mono (15401): Unhandled Exception: 09-01 20:56:01.292 E/mono (15401): System.InvalidCastException: Specified cast is not valid. 09-01 20:56:01.292 E/mono (15401): at (wrapper dynamic-method) System.Object:be601f56-8ff2-4aab-a41a-aababab502f5 (intptr,intptr,intptr) 09-01 20:56:01.292 E/mono (15401): at (wrapper native-to-managed) System.Object:be601f56-8ff2-4aab-a41a-aababab502f5 (intptr,intptr,intptr) 09-01 20:56:01.294 E/mono-rt (15401): [ERROR] FATAL UNHANDLED EXCEPTION: System.InvalidCastException: Specified cast is not valid. 09-01 20:56:01.294 E/mono-rt (15401): at (wrapper dynamic-method) System.Object:be601f56-8ff2-4aab-a41a-aababab502f5 (intptr,intptr,intptr) 09-01 20:56:01.294 E/mono-rt (15401): at (wrapper native-to-managed) System.Object:be601f56-8ff2-4aab-a41a-aababab502f5 (intptr,intptr,intptr)
Any clue on what might have gone wrong?
Hi! I'm trying to periodically check with a web service if a new item has been added to a database. If there's a new item a listview that the user sees should be updated.
I'm using PCL and I have accomplish it creating a new Task with a timer inside. But this only works if the app is open. I want to do the same when the app is closed so the user gets a notification when a new item is added remotely.
I've been doing some research and I found andoid services, the info said that the service will continue, regardless of the app state, until you tell it to stop. But i haven't found many examples in how to implement it.
Here's the code that I had that works only when the app is opened:
Task.Run(() =>
{
Device.StartTimer(TimeSpan.FromSeconds(secs), checkUpdates);
});
bool checkUpdates()
{
if (isOnline)
{
var lastUp= Application.Current.Properties["lastUpdate"] as string;
//returns true if a new item is added
if (service.newItem(DateTime.Parse(lastUp)))
{
var itm = service.getNewItem(DateTime.Parse(lastUp));
Device.BeginInvokeOnMainThread(() =>
{
notification.ShowNotification(itm.Title, 1000);
listView.Insert(0, itm);
}
});
}
App.Current.Properties["lastUpdate"] = DateTime.Now.ToString();
}
return true;
}
I'm trying to do the same with an Android service using dependency services, here's what I've got so far:
public interface IService
{
void Start();
}
[Service]
public class DependentService : Service, IService
{
public void Start()
{
var intent = new Intent(Android.App.Application.Context, typeof(DependentService));
Android.App.Application.Context.StartService(intent);
}
public override IBinder OnBind(Intent intent)
{
return null;
}
public override StartCommandResult OnStartCommand(Intent intent, StartCommandFlags flags, int startId)
{
// From shared code or in your PCL
return StartCommandResult.NotSticky;
}
}
The problem is that I don't know how to implement the code that I had in the timer to the service, can someone please help?
Hi guys i have a question regarding WCF datacontracts and and handling larger payloads on the client (Xamarin Forms)
Currently my app reads Configuration data off the server with
var setupdata2 = await Task.Factory.FromAsync<long, mynamespace.DTO.SetupData2>(
svc.BeginGetSetupData2,
svc.EndGetSetupData2,
App.SiteID,
null,
TaskCreationOptions.None);
Where SetupData2 Is a collection of objects is need on the client.
The more payload data i add into these collections the longer i wait.
But it seems unreasonable that i have to wait in excess of 2 minutes for data that i have estimated to be in the region of 5mb of data.
When i debug the UWP app locally on my machine it goes a lot faster but it seems that on a real tablet (Android and Windows) It just takes forever to come back and end the async call to EndGetSetupData2.
What are my options for speeding this up .
And what is a good payload size to start splitting up into multiple requests?
I have a Xamarin Forms app and in UWP I'd like to alter the colours of the ellipses button and secondary menu. I've been following the advice provided in another forum post (apparently, I'm not allowed to post links):
@MatthewR said:
If you want to change just the command bar's overflow background color you can change the FormsCommandBar style.Add this style (copied from Xamarin's Source Code) to your app.xaml in your UWP project.
You can then edit the CommandBarOverFlowPresenter's background Color like this:<Application xmlns:uwp="using:Xamarin.Forms.Platform.UWP" . . .> <Style TargetType="uwp:FormsCommandBar"> . . . <CommandBarOverflowPresenter x:Name="SecondaryItemsControl" Background="<YourBackgroundColorHere>" IsEnabled="False" IsTabStop="False" Style="{TemplateBinding CommandBarOverflowPresenterStyle}"> <CommandBarOverflowPresenter.ItemContainerStyle> <Style TargetType="FrameworkElement"> <Setter Property="HorizontalAlignment" Value="Stretch" /> <Setter Property="Width" Value="NaN" /> </Style> </CommandBarOverflowPresenter.ItemContainerStyle> <CommandBarOverflowPresenter.RenderTransform> <TranslateTransform x:Name="OverflowContentTransform" /> </CommandBarOverflowPresenter.RenderTransform> </CommandBarOverflowPresenter> . . . </Style> </Application>
I needed to do this to avoid changing action sheets and pickers background colors.
*Note: Make sure not to specify a x:key for the FormsCommandBar style or it won't work.
However, the style is not being applied. I put my style in the App.xaml resource dictionary. I'm using Xamarin Forms 2.5.0.280555.
Am I missing something?
I've created a custom listview with multiple cells, and added a cross icon to each viewcell in the list. While clicking on the cross icon particular cell will be removed from the list. Can anyone please let me know if there is any method of implementing any animation or any transition to a single view cell on deletion?
I'm following this plugin -github.com/danvanderboom/Xamarin-Forms-TreeView- for creating tree view but I'm not able to add plus and minus icon in tree view. The plus and minus icon should change as per the logic of ShowExpandCollapse property. Please help me with this ASAP. Your help will be appreciated.
i am using honeywell sl42 sled,i have included captuvo.dll to my app,able to fire follwing events getting rawdata for the scanned barcode
[Export("captuvoConnected")]
public void CaptuvoConnected()
{
}
[Export("captuvoDisconnected")]
public void CaptuvoDisconnected()
{
}
[Export("decoderRawDataReceived:")]
public void DecoderRawDataReceived(Foundation.NSData data)
{
}
But unable to get symbology name using below code,but this event is not getting fired
[Export("SymbologyName:")]
public string SymbologyName(Symbology symbologyname)
{
}
Thanks,
vijay
There are Pages, which can hold a variety of cross-platform views. Yet, there seems to be no way to isolate these and re-use them, ala .net controls. Isn't that the basic premise of reusable UI? I have scoured the internet, yet can find nothing after a couple years of tracing this. Am I missing something? Could someone point me in the right direction?
I have created a xamarin forms application which i want to run on windows 10 tablet only in landscape mode whether or not the deviceOrientation is on. I checked the checkBox of landscape and landscape-flipped in package.appxManifest but it still rotate in portrait mode. can anyone help me on this? How can I set my app to run in landscape?
Hi everybody!
I'm working with Map in Xamarin.Forms
I have a button to navigate to MapPage. Android app crash and show "The application is in break mode" but UWP work fine?