I have a NativeScript application with the ActionBar like the following image.
How can I force the ActionItem (3 bars icon) to be on the right side instead of the left side?
The problem is that on Android 10 and above, when device language is Hebrew (RTL language) the ActionItem is on the left and I would like to keep it right.
To align items inside the actionbar to the right, use:
<ActionBar title="HBreader">
<ActionItem
ios.position="right"
android.position="actionBar"
(tap)="doThisAndThat()"
>
// your view element here (image/icon/label/etc...)
</ActionItem>
</ActionBar>
Related
When creating a long string of text using a TextView on iOS and exceeding the height of the TextView it will allow you to scroll.
After scrolling back up to the top of the textview and selecting a piece of text my caret position is not correctly set and my textview will not scroll to the "tapped" position. This is probably caused by the overlapping keyboard.
I set up an easy to test template which is:
<template>
<Page backgroundColor="#6B00D4" backgroundSpanUnderStatusBar="true" actionBarHidden="true" class="page">
<GridLayout rows="auto">
<TextView row="0" height="auto"/>
</GridLayout>
</Page>
</template>
How will I be able to get the correct position when tapping on a piece of text?
EDIT: Just found out it only seems to happen on iOS 14
EDIT 2: The scroll position isn't used when positioning the caret, that's why the caret position seems off from the user tap position
EDIT 3: Seems to be a native iOS 14 issue: https://developer.apple.com/forums/thread/662056
I am developing a cross-platform application using native-script angular.
In Android, I face the issue in the selected indicator colour in the segmented bar. Anyone Knows how to change the selected indicator colour in the segmented bar. It shows the default color blue.
<SegmentedBar #tabs [items]="myItems" selectedIndex="0" (selectedIndexChange)="onSelectedIndexChange(tabs.selectedIndex)" class="m-5" selectedBackgroundColor="gray" ></SegmentedBar>
In the Segemented bar add the property selectedBackgroundColor="gray"
In Xamarin Forms application, when i turn on TalkBack/Screen Reader for Accessibility in Android and swipe through the screen the screen reader doesn't read text on screen like label's and other images, It only reads interactive elements like buttons. How to make the talk back read the label content on swipe.
You can set the AutomationProperties.IsInAccessibleTree to true for that label or other non interactive element.
<Label Text="My label. It speaks a story. The story is real" AutomationProperties.IsInAccessibleTree="True"/>
U can add custom extra detail for that label that Talkback will read loud.
<Label Text="My label. It speaks a story. The story is real" AutomationProperties.IsInAccessibleTree="True" AutomationProperties.HelpText="This label describes that"/>
see this for detail
I'm using a grid layout for a List View for a simple RSS reader, and want to reload the list if the user scrolls past the top (standard Android design pattern).
From the ui/gestures module I've tried the swipe and pan gestures, but I haven't been able to determine the scroll position from those. for example:
XML
<ListView pan="myFunc"items="{{ myItems }}">
<ListView.itemTemplate>
<GridLayout columns="*,3*" rows="*,2*">
...
</GridLayout>
</ListView.itemTemplate>
</ListView>
JS
function myFunc(args){
if(args.deltaY > 0 && args.deltaX > -10 && args.deltaX < 10){
console.log('swiping down');
}
}
invokes myFunc and I can determine deltaY, but I'm not sure how to find the vertical offset from it's args object to tell if the user is trying to scroll past the top.
I saw the ui/scroll-view module, but I don't know how that will interact with my GridLayout and ListView.
New to this project, and it feels like I'm overlooking something simple.
Would be grateful for any insight. Thanks!
I've got a page with the following XAML in my application.
<ScrollViewer VerticalScrollBarVisibility="Auto">
<toolkit:WrapPanel x:Name="WrapPanelImages" />
</ScrollViewer>
In the page constructor I load a set of images into the WrapPanel. These images are being displayed correctly but scrolling isn't working very well. I'm testing this on the emulator. The problem is that if I drag and scroll downwards as soon as I let the mouse go the ScrollViewer is scrolling back to the top. So it is impossible to get to the bottom of the WrapPanel. If I add the HorizontalScrollBarVisibility property to the ScrollViewer and set it to Auto I get a long line of images that flows off the screen horizontally, but the scrolling works in that case i.e. if I scroll to the right and let go of the mouse it doesn't scroll back to the left automatically.
How can I fix this scroll-to-the-top behavior? Or is this a bug in the emulator? My AppHub registration has not been approved yet so I can't sideload the app on my phone to test it.
At a glance this sounds like the same problem you get when wrapping a TextBlock in a ScrollViewer and you haven't constrained the ScrollViewer's size to the device height.
Check your ScrollViewer isn't some very large height such that the content is fitting entirely in it without needing to scroll.
If that is the case the action of it bouncing back is normal for trying to scroll past the beginning or end of the content.