Change colour of Scroll View Indicator for Android in Appcelerator - titanium

I have a scroll view defined in the XML file for a controller:
<ScrollView id="searchResultsContainer"/>
In the TSS, I show the scrollbar indicator to true:
"#searchResultsContainer":{
backgroundColor: "#fff",
layout: "vertical",
width: "100%",
top: "65dp",
height: "400dp",
showVerticalScrollIndicator: "true"
}
How do I set the colour of the scroll bar? It is currently grey and not very visible on a grey background.

You can edit these properties, create a new custom theme, you can set them to a 9 patch image for example.

Related

Circular border disappears when one side is set to transparent

For context, I'm trying to make a progress circle following this article; essentially, I'm overlaying coloured semi-circles made from borders on top of a base circular border to represent progress. These semi-circle borders are theoretically made by setting the bottom and left borders to transparent, but when I do this the entire border disappears.
This is the simplified portion of the code that I'm working with:
import { StyleSheet, View } from 'react-native';
export default function App() {
return (
<View style={styles.semicircle}></View>
);
}
const styles = StyleSheet.create({
semicircle: {
width: 200,
height: 200,
borderWidth: 20,
position: 'absolute',
borderLeftColor: 'transparent',
borderBottomColor: 'transparent',
borderRightColor: '#3498db',
borderTopColor: '#3498db',
borderRadius: 100
}
});
When I set the transparent border sides to black instead, the entire circle is visible like so, but having any transparent borders causes the entire border to disappear. How do I fix this? Any help would be greatly appreciated.

Titanium UiTextField Clear button is not at all visible in Dark Mode for iOS v13

I have been facing an issue with clearButtonMode property of UiTextField in my input box. If I use app in light mode then everything work well but the moment I switched to dark mode that clear button is not at all visible in input box.
So, Just want to know is it Possible to add backgroundColor to that button for dark mode?
Or is there any possibilities to make it visible in Dark Mode.
I have attached the code and screenshot of my problem.
Here is text Field code.
var checkField = Ti.UI.createTextField({
width: Ti.UI.FILL,
height: 30,
top: 10,
left: 10,
right: 10,
color: '#000000',
backgroundColor: 'white',
tintColor: '#000000',
borderStyle: Ti.UI.INPUT_BORDERSTYLE_ROUNDED,
returnKeyType: Ti.UI.RETURNKEY_DONE,
clearButtonMode: Titanium.UI.INPUT_BUTTONMODE_ALWAYS,
});
Screenshot:
Thanks in Advance!!!
it looks like it is a very light grey (when you set it to a dark backgroundColor you'll see the X again.
But it looks like it is native behavior:
https://developer.apple.com/forums/thread/124973
and you'll need to create a custom textfield image (https://stackoverflow.com/a/10274246/5193915) but that means inside the SDK.
As a quick workaround I would just create an image and place it on top of the TextField and move it to the right corner.

React native expand View full screen above header and footer component

We have a situation where on a screen there are multiple View components are present. And each component has some progress bar related stuff.
But when the user taps on any View, we want to expand it to the full screen and we are doing it by applying a new style,
fullscr: {
top: 0,
left: 0,
height: "100%",
width: 100%,
width: Dimensions.get('window').width,
height: Dimensions.get('window').height,
position: 'absolute',
justifyContent: 'center',
alignItems: 'center',
}
But the View is not expanding above Header and Footer of native base. It is expanding rest of the view but not Header and Footer.
I tried zIndex and elevation option but no luck. How can I expand a view to fill the entire screen?
You can conditionally hide the footer and header of native-base, that way in the Container component of native-base you have your view inside Content.
<Container>
{condition ? <Fragment> :<Header/>}
<Content>
{{Your main view goes here}}
</Content>
{condition ? <Fragment> :<Footer/>}
</Container>

How do I clear center area in react native

I want to create an overlay on top of react-native camera. However, I want only the center area to be clear and all other area to have some overlay with small opacity.
I have created component which acts as a wrapper and add corners, but I can't get overlay except in center. If I add overlay with background opacity it applies to whole screen including center box.
This is what I have so far.
<Camera style={[cameraStyle.camera]}>
<CustomView center style={[cameraMarkerStyles.container]}>
<CustomView
transparentBg
spaceBetween
style={[cameraMarkerStyles.cameraMarker]}
>
<CustomView row spaceBetween>
<CornerBox status={status} position="topLeft" />
<CornerBox status={status} position="topRight" />
</CustomView>
<CustomView row spaceBetween>
<CornerBox status={status} position="bottomLeft" />
<CornerBox status={status} position="bottomRight" />
</CustomView>
</CustomView>
<CustomView
style={[cameraMarkerStyles.container, cameraMarkerStyles.overlay]}
/>
</CustomView>
</Camera>
Bascially I add a View which is center area, which has 4 boxes at all corners which create the border. And then at the end there is a View which acts as overlay for whole screen. Now that last View if I change the background color to something other than transparent, it covers center area as well.
I have tried changing zIndex, set it to -1 as well. However that also did not work.
One very dirty solution that I have is I can place a View above center area and below center area and on each side of it and then give those views as some background and opacity. In that way we can add overlay just apart from center area.
Does anyone know any good way to implement such kind of layout? Even simple idea is enough, I don't need whole code.
Adding styles just in case anyone needs to see.
const markerSize = 250
const cornerBoxSize = 50
const cornerBoxBorderSize = 5
const cameraMarkerStyles = StyleSheet.create({
container: {
...StyleSheet.absoluteFillObject,
},
overlay: {
zIndex: -1,
backgroundColor: 'rgba(0, 0, 0, 0.2)',
},
cameraMarker: {
width: markerSize,
height: markerSize,
},
cornerBox: {
width: cornerBoxSize,
height: cornerBoxSize,
},
topLeftBox: {
borderTopWidth: cornerBoxBorderSize,
borderLeftWidth: cornerBoxBorderSize,
},
})
const cameraStyle = StyleSheet.create({
camera: {
height: Dimensions.get('screen').height,
backgroundColor: 'transparent',
},
})
we talked about this on Twitter but I wanted to make sure the proposed solution was logged...
I suggest you create four translucent gray boxes for the four sides of the screen. The center of the screen will be blank and those four boxes will form a mask on each side of the center-area

Titanium Alloy scrolling stops immediately on Android

I'm using Titanium 3.4 and Ally 1.5.1 for a crossplatform app (iOS and Android).
I have a problem with my TableViews and ScrollViews. When the content is larger than the screen, the Views are correctly scrollable but on iOS when I use a swipe gesture the view keeps scrolling for a bit until it comes to a stop. On Android however, as soon as I pull my finger from the screen it stops scrolling.
I've installed the "Todo list" sample app and it doesn't have this behaviour on Android, after a swipe the list keeps scrolling.
How can I activate this continuous scrolling feature on Android? (or how did I accidentaly deactivate it)
A sample view:
<Alloy>
<View id="experiencesList">
<View id="contentWrapper">
<TableView class="cTable" id="experienceTable" onClick="experienceListOnClick"/>
</View>
</View>
</Alloy>
A sample tss:
"#experiencesList":{
width: Ti.UI.Fill,
height: Ti.UI.Fill,
layout: "absolute"
},
"#contentWrapper":{
top: "0dp",
height: Alloy.Globals.appConfig.contentHeight,
backgroundColor: "white"
},
"TableView":{
height: Ti.UI.SIZE,
top: 0,
separatorInsets: {
left: 0,
right: 0
},
scrollable: true,
separatorColor: "black"
},
"TableView[platform=ios]":{
scrollIndicatorStyle: Titanium.UI.iPhone.ScrollIndicatorStyle.BLACK
}
Do you have a 'swipe' event defined somewhere? I've experienced this on Android when I have a horizontal swipe on a Listview that also has vertical scrolling.
The issue below from Titanium resolved with a "Won't fix" is stating that this is standard Android behavior:
The swipe event is eating the scroll event. This is expected behavior
with the current Android architecture. Swipe event is not recommended
to use along with a scrollable widget.
https://jira.appcelerator.org/browse/TIMOB-16344