xsml file as below its display good in web browser but not showing in Android Emulator.
<Alloy >
<Window id="readWin" class="bg">
<TableView id="tableView">
<TableViewRow class="titlebar"></TableViewRow>
<TableViewRow></TableViewRow>
<TableViewRow>
<TextField class="serachbar"></TextField>
</TableViewRow>
<TableViewRow></TableViewRow>
<TableViewRow center="center" width="190" height="63">
<Button class="sbtn" id="subbtn"></Button>
</TableViewRow>
</TableView>
</Window>
</Alloy>
my index.tss code is like
'#tableView':{
separatorColor:'none'
}
"View":{
layout:'vertical',
},
".bg":{
backgroundImage:'images/bg.png',
},
".titlebar":{
backgroundImage:'images/logo.png',
width:'339dp',
height:'71dp',
top:'140dp'
},
'.serachbar':{
backgroundImage:'images/searchbar.png',
width:'400dp',
height:'50dp',
borderStyle:'none',
},
'.sbtn':{
backgroundImage:'images/btn.png',
width:'187dp',
height:'60dp',
borderStyle:'none',
}
my index.js file code is
$.readWin.open();
bg css is applying at window successfully but tableview data is not showing in Andriod Emulator event its good display in Web Browser. what can be the problem please help
Kind of an old post, but I thought I'd add my 2 cents. First, there's no way we can test this code because we don't have the referenced images. Second, remove all the dp references in your code by adding this line to your tiapp.xml <property name="ti.ui.defaultunit" type="string">dp</property>. Finally, explain what you've tried, and what you're trying to accomplish. Your post lacks a great deal of information that would allow others to help you.
Related
I am trying to develop a photo app using the PictureChooser plugin. I see that the sample uses Xamarin.iOS. I've googled for examples where the plugin uses Xamarin.Forms but can't find any. I understand how binding works for labels, text editors, and buttons; however, the binding btw the page's image control and the viewmodel's byte[] has got me stomped.
DAA.UI project:
In CameraPage.XAML:
<Image x:Name="MyImage"
Source="{Binding Bytes, Converter={StaticResource InMemoryImage}}"
Aspect="Fill"
HeightRequest="{OnPlatform iOS=300, Android=250}"
WidthRequest="{OnPlatform iOS=300, Android=250}"
HorizontalOptions="Center" />
In App.XAML:
<?xml version="1.0" encoding="utf-8" ?>
<Application
x:Class="DamageAssessmentApp.UI.App"
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:d="clr-namespace:MvvmCross.Forms;assembly=MvvmCross.Forms"
xmlns:resources="clr-namespace:DAA.UI.Resources"
xmlns:local="using:DAA.UI"
xmlns:nativeValueConverters="using:DAA.UI.NativeValueConverters">
<Application.Resources>
<!-- Application resource dictionary -->
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<resources:Colors />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
<nativeValueConverters:NativeInMemoryImageValueConverter x:Key="InMemoryImage"/>
</Application.Resources>
</Application>
Value Converter file:
using MvvmCross.Forms.Converters;
namespace DAA.UI.NativeValueConverters
{
public class NativeInMemoryImageValueConverter : MvxNativeValueConverter<MvxInMemoryImageValueConverter>
{
}
}
The compiler can't find MvxInMemoryImageValueConverter in the value converter file.
If you are using MVVMCross you should find an example that works with Xamarin.Forms, in which case a good place to start it's their Github.
Or you have to implement it in each platform and use a DependencyService to get the implementation
Other Alternatives
Xamarin Community Toolkit
Another alternative for a camera App is Xamarin Community Toolkit Camera View. In that same link there is an example. But there are more examples in their Github. This is fully compatible with Xamarin.Forms and brings a little more control over the CameraView
Xamarin.Essentials
Xamarin.Essentials offers the MediaPicker that let's the user upload a photo from the gallery or take a new one. But the action of the photo in handled by the OS, so for you it's like a black box. You call the function, and get the photo.
I'm making a simple application for school, but one thing just wont work. I'm trying to make a button, that when you press it, you go to another page, aka, loads a new fxml file.
here's my code for the buttons so far.
<Button prefWidth="240.0" styleClass="first, active" text="HOME">
<VBox.margin>
<Insets top="40.0" />
</VBox.margin>
</Button>
<Button prefWidth="240.0" styleClass="first, active" text="Dashboard">
<VBox.margin>
<Insets top="40.0" />
</VBox.margin>
</Button>
and I cant seem to make the button for Dashboard work so that it loads the Dashboard Page
i'm not sure if I totally understood your question but here's a possible solution : Follow the tutorial in this : managing multiple screens in javafx
it's clear, easy and well organised and you can dowload the full implementation with three testing screens
I'm working with JavaFX and trying to use FXML, however I've never had any sort of formal training in it, so I'm kind of stumbling about.
I keep running into this here error:
Caused by: javafx.fxml.LoadException: Element does not define a default property.
My aim is to try to initialize a Custom Controller class that runs its own FXML file. The code example given by Oracle therefore looks like this:
<fx:root type="javafx.scene.layout.VBox" xmlns:fx="http://javafx.com/fxml">
<TextField fx:id="textField"/>
<Button text="Click Me" onAction="#doSomething"/>
</fx:root>
where the controller and root is set in the Controller method.
I'm trying to adapt this code to my own needs, and I was wondering if someone could explain to me why this error comes up if the fx:root type="javafx.scene.layout.VBox" is ever changed to something like fx:root type="javafx.scene.Parent" if you want me to, I can post some actual code samples.
The concept of default-property is introduced to short circuit your FXML in reality you'd have to write:
<fx:root type="javafx.scene.layout.VBox" xmlns:fx="http://javafx.com/fxml">
<children>
<TextField fx:id="textField"/>
<Button text="Click Me" onAction="#doSomething"/>
</children>
</fx:root>
if you now change the container type to Parent and you browse the parent class you'll notice that it does not define a children-property which you implicitly assume - children is introduced by Pane.
You should probably read http://docs.oracle.com/javafx/2/api/javafx/fxml/doc-files/introduction_to_fxml.html
I am working with a task right now which I need to display the existing features of a "table" plugin. However, I am having a hard time enabling it. When using this code below, I only get to have the table properties feature. That's the only displayed tool/icon I have on my richtext editor. Can somebody help me enable/display other features/icons such as (insertcolumn, insertrow, etc)?
<tableField jcr:primaryType="cq:Widget" xtype="richtext">
<rtePlugins jcr:primaryType="nt:unstructured">
<table jcr:primaryType="nt:unstructured" features="*" />
</rtePlugins>
</tableField>
I have tried doing this (below) but I still failed.
<tableField jcr:primaryType="cq:Widget" xtype="richtext">
<rtePlugins jcr:primaryType="nt:unstructured">
<table jcr:primaryType="nt:unstructured" features="[insertcolumn,insertrow]" />
</rtePlugins>
</tableField>
http://dev.day.com/docs/en/cq/current/administering/configuring_rich_text_editor.html
That's the only toolbar button that the table plugin provides. To use the other features, right-click on the table itself:
I am trying to figure out if XUL is a good candidate for GUI forms in intranet apps.
It's been difficult to find anyone who actually uses it though. Therefore I thought I'd ask for a hello world style example.
Suppose I have a php page that does nothing but display any content sent to it via HTTP POST. (e.g., http://mysite.com/postdumper.php)
Can anyone show me the bare minimum code it would take to create an XUL form that collects firstname, lastname, and age, and allows me to POST that to the URL above?
Any links or Fine Manuals or references that give such an example are more than welcome.
I use it for an intranet application and have done that for a few years now. It can be hard to start with, but once you understand a few things it's easy to make it work for you.
Forgot almost everything you knew about HTML. It's NOT HTML and there are alot of things you can't do the old way, but then there are an incredible amount of other things you can do instead.
Everything communication wise is done with javascript, and not forms.
Overlays have nothing to do with div's. But it's hugely useful for splitting up a design for larger projects.
If an XUL page is not correctly formated in all tags, the page won't even display.
There is a google groups where the main purpose is to discuss remote XUL :
http://groups.google.com/group/remotexul
It's not quite active yet, but more members are more than welcome :)
Here is an minimal example:
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<window id="yourwindow" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script language="javascript">
function send()
{
var firstName = document.getElementById('firstName').value;
var lastName = document.getElementById('lastName').value;
var age = document.getElementById('age').value;
var postData = "firstName="+firstName;
postData += "&lastName="+lastName;
postData += "&age="+age;
var req = new XMLHttpRequest();
req.open("POST", "/test.php", false);
req.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
req.send(postData);
alert(req.responseText);
}
</script>
<hbox>
<vbox>
<hbox>
<label value="First Name" control="firstName"/>
<textbox id="firstName"/>
</hbox>
<hbox>
<label value="Last Name" control="lastName"/>
<textbox id="lastName"/>
</hbox>
<hbox>
<label value="Age" control="age"/>
<textbox id="age" value="30" type="number"/>
</hbox>
<button onclick="send()" label="Send"/>
</vbox>
</hbox>
</window>
I would also like to stress that you should look into sending data back and forth between XUL and PHP using a XMLRPC or JSON framework instead. JSON support will come as built-in in Firefox 3.5.
Another things is that until Firefox 3.5 arrives you cannot do cross-site XMLHttpRequest's unless you do some configuration in about:config. Which means that only xul on mysite.com can send requests to mysite.com/postdump.php.
Create a series of < textbox>'s, add a submit < button>, and after reading the data from the textboxes, send it using xmlhttprequest. You can use GET or POST.
you can use plain old xhtml forms provided that you use its namespace in XUL since it is XML.