I am using Xamarin.forms version 3.0.0.561731 for the Application.The issue is, when a button is clicked another button like object at top left corner is appearing for few seconds which is very annoying, I have been searching for couple of hours and tried what ever stuff found but no luck.
I tried upgrading to latest xamarin.forms version and also tried to downgrading it upto 2.4.0 but still the issue exists.
Please guide me to get rid of that visual effect issue while tapping/clicking on button.
<Button BorderRadius="5" Text="Continue" HorizontalOptions='FillAndExpand' BackgroundColor="#1976D2" TextColor="White" Command="{Binding ContinueFormCommand}">
<Button.FontSize>
<OnIdiom x:TypeArguments="x:Double">
<OnIdiom.Phone>
<OnPlatform x:TypeArguments="x:Double" iOS="13" Android="15" WinPhone="30"/>
</OnIdiom.Phone>
<OnIdiom.Tablet>
<OnPlatform x:TypeArguments="x:Double" iOS="13" Android="15" WinPhone="30"/>
</OnIdiom.Tablet>
</OnIdiom>
</Button.FontSize>
<Button.HeightRequest>
<OnIdiom x:TypeArguments="x:Double">
<OnIdiom.Phone>
<OnPlatform x:TypeArguments="x:Double" iOS="13" Android="45" WinPhone="30"/>
</OnIdiom.Phone>
<OnIdiom.Tablet>
<OnPlatform x:TypeArguments="x:Double" iOS="13" Android="15" WinPhone="30"/>
</OnIdiom.Tablet>
</OnIdiom>
</Button.HeightRequest>
</Button>
I got this issue for Samsung device.
This issue is open for way too long on GitHub here and here.
As a work around, you can using Xamarin.Forms v2.5.0.122203 which doesn't have the issue.
Related
I am having an issue while using observable collection in XAML. I have created tabs on my Xamarin.Forms application using observable collection in XAML and for accessing observable collection in XAML I have included this namespace
xmlns:col="clr-namespace:System.Collections.ObjectModel;assembly=System.ObjectModel"
when I am writing System.ObjectModel in assembly it is working fine in iOS and UWP but crashing on Android. If I am writing netstandard assembly instead of System.ObjectModel then it is working fine in Android but crashing in iOS and UWP.
I have tried installing System.ObjectModel package in my project but it didn't work.
My XAML looks something like this
<ResourceDictionary>
<!-- Default list -->
<xcoll:ObservableCollection x:Key="NewTabs" x:TypeArguments="model:ISequenceItem">
<test:FirstPage Order="1" Text="Page 1" />
<test:SecondPage Order="2" Text="Page2" />
<test:ThirdPage Order="3" Text="Page3" />
</xcoll:ObservableCollection>
</ResourceDictionary>
<test:Tabs
ItemSource="{Binding Path=NewTabs}"
SelectedItem="{Binding Path=SelectedTab}">
When i upload a relese to Google Play Console, after internal testing y have a warning (Accessibility => Content labeling) associated to this component.
<ImageButton .../>
Here the recomendation is use android:contentDescription
Then i add xmlns:android="http://schemas.android.com/apk/res/android"
and:
<ImageButton android:contentDescription="bla bla" .../>
But i get an error: The property contentDescription was not found in type ImageButton.
I try to use xct:SemanticEffect.Description and i have not compiler error but in Google Play Console i still see the warning.
More Information:
Full component code:
<ImageButton BackgroundColor="Transparent" Margin="5" xct:SemanticEffect.Description="abrir menú" Clicked="OnBackButtonClicked" >
<ImageButton.Source>
<FontImageSource FontFamily="FAL" Glyph="" Color="{StaticResource Gray3}" Size="25"/>
</ImageButton.Source>
</ImageButton>
Google Play Console - Pre-launch report details - Accesibility tab
Content labeling warning for this component
As already pointed out, you cannot add android:contentDescription="bla bla" directly to the ImageButton one is from the Android platform, the latter is on the Xamarin.Forms level.
If you use the Xamarin Community Toolkit and apply the SemanticEffect.Description="bla bla" that should translate into the contentDescription on Android. If that is not the case, I would be curious to know what the exact warning is that you get after applying it.
I am new to Xamarin (and Xamarin.Forms if they are different). I placed some Entries on page. As soon as I tap one on real Android 4.4 device or inside 4.4 emulator, the application crash with error:
Android.Content.Res.Resources+NotFoundException: 'File res/drawable/abc_ic_clear_material.xml from drawable resource ID #0x7f07001d'
No crash on Android 6.0 real device and 9.0 emulator. I think crash somehow related with ClearButtonVisibility="WhileEditing", because there is clear in missing XML.
<Entry Grid.Row="2" Grid.Column="1" ClearButtonVisibility="WhileEditing" Keyboard="Numeric" Text="15" TextChanged="PriceEntry_TextChanged" />
<Entry Grid.Row="2" Grid.Column="2" ClearButtonVisibility="WhileEditing" Keyboard="Numeric" Text="0" TextChanged="AmountEntry_TextChanged" />
This is how I define Entries in XAML. I want my app to specifically work under Android 4.4. What to do?
I was able to reproduce this issue.
To fix this, please try adding the code below into your MainActivity.cs OnCreate method:
Android.Support.V7.App.AppCompatDelegate.CompatVectorFromResourcesEnabled = true;
Let me know if you have any other questions or concerns.
I've just started Windows phone 8 development with previous experience of Android Development.
I was just searching if there is any strings.xml like file in windows phone 8 where we can keep strings and specially color codes. Yes i want to keep my own color codes in windows phone 8 project so that i may refer these colors in my Pages XML and in code.
Suggestions are highly appreciated.
Special color codes can be placed in your App.xaml file in the resources part.
Use like the following:
<Application.Resources>
<SolidColorBrush x:Key="ColorWhite"
Color="#FFFFFFFF" />
<ImageBrush x:Key="BackGroundBrush"
ImageSource="SplashScreenImage.jpg" />
<Style x:Key="MyPageStyle"
TargetType="phone:PhoneApplicationPage">
<Setter Property="Background">
<Setter.Value>
<ImageBrush ImageSource="Background_WindowsPhone.png"
Stretch="UniformToFill" />
</Setter.Value>
</Setter>
</Style>
</Application.Resources>
In your page you might then use the following:
<phone:ApplicationPage Style="{StaticResource MyPageStyle">
<Grid Background="{StaticResource BackGroundBrush}">
<TextBlock Text="Hi"
Foreground="{StaticResource ColorWhite}" />
</Grid>
</phone:ApplicationPage>
In 2 seperate web applications, one using asp.net 3.5 with vs2008 and 4.0 with vs2010, the child menu items of an asp.net menu dissappear only on android browser. When the main menu item is clicked the children flash for a split second then dissappear.
Edited version of menu is as follows:
<asp:Menu ID="MainMenuEmp" runat="server" CssClass="menuASP" Orientation="Horizontal" DynamicHorizontalOffset="0"
StaticDisplayLevels="1" StaticEnableDefaultPopOutImage="false" DynamicVerticalOffset="1" visible="false"
>
<StaticMenuitemStyle CssClass="menuitemASPStatic" />
<StaticHoverStyle CssClass="menuASPStaticHover" />
<StaticSelectedStyle CssClass="menuASPStaticHover" />
<DynamicMenuStyle CssClass="menuASPDynamicMenuStyle" />
<DynamicMenuitemStyle CssClass="menuitemASPDynamic" />
<DynamicHoverStyle CssClass="menuASPDynamicHover" />
<DynamicSelectedStyle CssClass="menuASPDynamicHover" />
<Items>
<asp:MenuItem Text="HISTORY" Value="#" navigateurl="~/clientpages/jobhistory.aspx" />
<asp:MenuItem Text="NEW ORDER" Value="#" navigateurl="~/clientpages/newjob.aspx" />
<asp:MenuItem Text="CLIENT INFO" Value="#" navigateurl="~/clientpages/clientinfo.aspx" />
<asp:MenuItem Text="MGMT" Value="#" Selectable="false" >
<asp:MenuItem Text="Inspections" Value="#" navigateurl="~/clientpages/MgrInspection.aspx" />
<asp:MenuItem Text="Tasks" Value="#" navigateurl="~/clientpages/MgrInspectionStatus.aspx"/>
<asp:MenuItem Text="Last Vehicle Inspection" Value="#" navigateurl="~/clientpages/MgrInspectionVehicle.aspx"/>
</asp:MenuItem >
<asp:MenuItem Text="JOB MGMT" Value="#" navigateurl="~/clientpages/jobdailyview.aspx"/>
</Items>
</asp:Menu>
partial css is as follows: (z-index is needed to get sub menu's to show on other browsers).
.menuASPDynamicMenuStyle
{
z-index: 999; /*padding: 4px 0 3px 0;*/
padding: 0;
margin-top: 1px;
background-color: #F8F8F8;
}
Menu is on master page with toolscriptmanager on page.
The following code is in init event of masterpage:
If Request.ServerVariables("http_user_agent").IndexOf("Safari", StringComparison.CurrentCultureIgnoreCase) <> -1 Then
Page.ClientTarget = "uplevel"
End If
This was necessary to get child menu's to show on other browsers as well. I tried:
page.clienttarget = "uplevel"
without the condition, but, this did not work.
I have also tried adding an android browser file, but, this did not work.
I have scoured the web for a few days. There a few similar questions, but, no answers. Has anyone had same problem? The menu works fine in ie, chrome, ff, safari, ipad, but, not on android mobile devices and not on android tablets.
There is no hover on an Android but my asp menu works if I hold down on the parent menu. Sadly I also get the browser menu when I hold down on it. You will have to design a menu that opens the child items with a single click. This cannot be done with the asp menu.
menus are not disappearing but the page is posting back..
just set navigateUrl property to 'javascript:return false'
I found a way to fix this.
Either do
document.body.setAttribute('onclick', 'setTimeout(function () { }, 0);');
in a startup script
or let the body tag look like this
<body onclick="setTimeout(function () { }, 0);">
Then it works on Android. I haven't tested on other iPhone or so.
(I have also tried some more conventional ways of adding this dummy script, but it did not work.)