issue in appcelerator createlabel visible false - titanium

I have created a label using Titanium.UI.createLabel and set its property visible:false. But it is showing in windows phone.
I have tried with changing its zindex with respect to main layout but didn't work.
Did anyone face same problem in appcelerator in windows phone?
Any help is appreciable. Thank you!
var lblStatus=Titanium.UI.createLabel({
text:L("Status_header"),
textAlign:"left",
height:"20dp",
left:"8dp",
top:"361dp",
width:"305dp",
visible:false,
zindex:0
});

Try these two things:
visible: "false"
height: 0

Related

react-native-youtube: App crashes after switching to another screen and back

Please, help me to solve the proplem with app crash. I use react-native-youtube and everything works as expected except of one moment: after navigating to another screen and returning back - the app crashes without eny error in logs. Screens are placed in different stacks (doesn't sure if it means something).
Does anyone know what can be the reason of such error?
This is a WebView library issue and the fix is to set its opacity to 0.99.
<YoutubePlayer
play={false}
videoId={videoId}
webViewStyle={{opacity: 0.99}}. <==== add this
/>
<YoutubePlayer
play={false}
videoId={videoId}
resumePlayAndroid={false} <-- this helps (back crash)
/>
Unfortunately none of the above worked for me with react-navigation v6 but I've found a workaround.
To webViewProps, you can pass androidLayerType which has 3 possible values:
none (no video is rendered)
software (I also got no video on test device)
hardware (this setting is actually rendering the video layer but also causing the crash)
If you first pass software and then switch it to hardware as soon as the video is ready for rendering then there is no crash anymore.
const [isReadyForRender, setIsReadyForRender] = useState(false);
function onReady() {
setIsReadyForRender(true)
}
<YoutubePlayer
height={height}
play={playing}
videoId={videoId}
onReady={onReady}
webViewStyle={{opacity: 0.99, display: isReadyForRender ? 'flex' : 'none'}}
webViewProps={{androidLayerType: isReadyForRender ? 'hardware' : 'software'}}
/>

Showing Tick Marks on input[type=range]

I'm creating a windows 8 app and need to create a vertical slider that also displays tick marks. I'm able to get the range slider to appear vertically by appying the windows specific class: win-vertical.
There are also psuedo-selectors for input[type=range]::-ms-ticks-after and input[type=range]::-ms-ticks-before but I cannot find any documentation on how to use them correctly and any rules I add to them seem to not do anything. Any help would be greatly appreciated. Thx
Have you tried the -ms-track selector? Detailed here: http://msdn.microsoft.com/en-us/library/windows/apps/hh465813.aspx
I tested this in IE10 (should be equivalent to Windows 8) and I am able to set the tick marks to red using the following CSS.
input[type=range]::-ms-track { color: red; }

How to change the default value for border-radius on buttons in sencha touch 2?

I'm usin Sencha Touch 2, I need to change the default border-radius for the buttons in my app.
How can MAKE IT? PLEASE PROVIDE ME A SAMPLE OF CODE.
THANKS
I would try something like this :
.x-button {
border-radius:0.2em !important;
}
Only if you are sure you wanna change the border-radius of every single button in your app.
Hope this helps
include
$button-radius: '2px';
in your custom-theme.scss file
then compile the scss file using the command compass compile.

How to set a JavaFX Stage/Frame to Maximized

I'm using JavaFX 2. I want my frame to open maximized but I'm not seeing a way. I searched a bit on the internet without success. For the stage I see setFullScreen() and setIconified() but I don't see anything like setMaximized().
The Java 8 implementation of the Stage class provides a maximized property, which can be set as follows:
primaryStage.setMaximized(true);
When evaluating the sourcecode of the Ensemble.jar provided with the samples of JavaFX 2.0 SDK, the currently valid way to achieve window maximizing is
Screen screen = Screen.getPrimary();
Rectangle2D bounds = screen.getVisualBounds();
primaryStage.setX(bounds.getMinX());
primaryStage.setY(bounds.getMinY());
primaryStage.setWidth(bounds.getWidth());
primaryStage.setHeight(bounds.getHeight());
(you find similar code in WindowButtons.java)
The 'maximize' button is still enabled and when clicking it, the windows will grow a bit more (Windows OS). After this the 'maximize 'button is disabled. In the provided example the standard buttons are replaced. Maybe this is still an issue.
Better use Multi-Screen compatible maximize logic:
// Get current screen of the stage
ObservableList<Screen> screens = Screen.getScreensForRectangle(new Rectangle2D(stage.getX(), stage.getY(), stage.getWidth(), stage.getHeight()));
// Change stage properties
Rectangle2D bounds = screens.get(0).getVisualBounds();
stage.setX(bounds.getMinX());
stage.setY(bounds.getMinY());
stage.setWidth(bounds.getWidth());
stage.setHeight(bounds.getHeight());
try this simpler code
primaryStage.setMaximized(true);
and it fills up the whole screen
. note that if you remove maximize/minise buttons the application will fill the whole screen as well as remove the taskbar so mnd your initStyles if you have any
Use this to remove the Minimise, Maximise Buttons :
primaryStage.initStyle(StageStyle.UTILITY);
Where primaryStage is your Stage object.

Adding a new line in a textArea with Appcelerator Titanium for iPhone

I have tried both Titanium.UI.RETURNKEY_DEFAULT and Titanium.UI.RETURNKEY_NEXT,
but neither will add a new line in the text area. Titanium.UI.RETURNKEY_DEFAULT just closes the keyboard.
I see that there was a related bug report here -
http://jira.appcelerator.org/browse/TIMOB-470?page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#issue-tabs
It is marked as fixed, but doesn't seem to have been added to the release I'm working with.
Does anyone have a work around for this?
Thanks!!
Try to add this property to your TextArea:
suppressReturn: false
I tested this with iPhone and can confirm that it works.