How can I fix an element at the screen in react native. Something like a position fixed in css - expo

Because there's no position fixed in react native:
Invariant Violation: Invalid prop position of value fixed supplied to StyleSheet input, expected one of ["absolute","relative"].
StyleSheet input: {
"position": "fixed",
"top": 465,
"height": 40,
"width": 300,
"borderWidth": 1,
"paddingHorizontal": 20,
"margin": 5,
"borderRadius": 20
}

in react native, you can use
Position:'absolute',
left:0,
top:0,
remember position absolute is limited to its parent view

Related

How to make 2 figures overlap in raphael.js

I'm completely new at raphael and never have been especially good working with canvas elements. I found a useful piechart but need to tweak it a little more to fit my needs.
This is what I have now : http://jsfiddle.net/El4a/sbxjfafx/4/
And this is the figure I want to achieve
The white circle I'm trying to draw on top of the piechart, appears underneath it instead. I honestly have no idea how to fix this, although I'm sure the solution won't be that difficult.
I can achieve this figure using manual positioning (which is a crappy way) with the following code:
var paper = Raphael(10, 50, 500, 500);
var circle = paper.circle(280, 180, 175);
circle.attr("fill", "white");
circle.attr("stroke", "#fff");
But obviously this won't scale with the piechart, and is easily ruined by inconvenient things like changing the window size.
I have tried putting that code inside a function and create it the same way the piechart gets created.
Raphael.fn.circle = function(cx, cy, r){
var paper = this,
rad = Math.PI / 180,
chart = this.set();
var circle = paper.circle(280, 180, 175);
circle.attr("fill", "white");
circle.attr("stroke", "#fff");
return chart;
};
raphael("circle", 700, 700).circle(350, 350, 175, values, labels, "#fff");
But that leaves me with the result you can see in the fiddle.
Hope anyone can help!
Thanks in advance.
Make sure you don't create the canvas twice. So create it once, and then use that reference to create the new elements.
Also place the circle after the coloured one, so that it appears in front. This is all about the order of elements in the DOM.
eg jsfiddle
Relevant amended code.
var r = raphael("holder", 700, 700);
r.pieChart(350, 350, 200, values, labels, "#fff");
r.circle(350, 350, 175).attr({ fill: 'white' });

winapi - resource file, dialog units

I have dialog which width and height is specified in .rc (resource file).
For example:
ErrorDialog DIALOG 10, 10, 300, 110
STYLE WS_POPUP | WS_BORDER
CAPTION "Error!"
{
CTEXT "Select One:", 1, 10, 10, 280, 12
PUSHBUTTON "&Retry", 2, 75, 30, 60, 12
PUSHBUTTON "&Abort", 3, 75, 50, 60, 12
PUSHBUTTON "&Ignore", 4, 75, 80, 60, 12
}
Everything works OK, but when I try it to another computer, dialog don't looks like in my computer. It is bigger and buttons are not in correct place in dialog.
I found that dialog units are dependent on system font size, but I don't know if this thing causes the problem.
If yes, how can I solve this problem to have same look of dialog.
I try it into same resolution of monitor on both computers, so problem is not with resolution.

KO Grid Scrollbars not visible & Display issues

I am having two problems with KOgrid.
1) I could not get scroll bars in the kogrid .It is very difficult to do data entry without scroll bars.
2) I also could not get kogrid to working wihout specifying hard coded height and width.In my application I can not have a fixed height and width.
Did anybody else had the same issue ?
I tried a workaround suggestion from this thread ( using jQuery fix as last line in my viewmodel).
KO Grid Display Isseues, On resize Gird shows one row. Images also included
that just increased that size of the grid but it did not display any data . However, when I resize the page data shows up.
Below are my HTML and kogrid options ( I tried with and without paging options, Ideally I do not want to use paging )
<div data-bind="koGrid: gridOptions"
style="height: 800px; background-color: none;width: 1850px;">
</div>
self.gridOptions = {
data: self.mydatarray,
footerVisible: true,
displaySelectionCheckbox: true,
afterSelectionChange: self.RowSelectionChange,
rowHeight: 50,
selectWithCheckboxOnly: true,
enableSorting: false,
multiSelect: true,
selectedItems: self.SelectedRows,
enableColumnResize: true,
showFilter: false,
canSelectRows: true,
enablePaging: true,
pagingOptions: {
currentPage: ko.observable(1),
pageSize: ko.observable(3),
pageSizes: ko.observableArray([3, 6, 9])
},
rowTemplate: errrowtmpl,
columnDefs: [
{ field: 'Customer', displayName: 'Customer', cellTemplate: Customersddedittmpl, headerCellTemplate: headercelltmpl },
...
...
{ field: 'GenNotes', displayName: 'GenNotes', cellTemplate: simpleedittmpl, headerCellTemplate: headercelltmpl }
]
}
Please let me know if you need any more information
Thanks
Kenner Dev
I found a solution to the problems I am facing.
1) I used Jquery to add scroll bar. I added code line below as last line of my data loading function. I am not sure id this breaks any other KOGrid functionality.In my application I did some basic testing and it seems to be working fine.
$("div.kgViewport").css("overflow", "scroll");
2) I still dont know how to solve this problem 100%. It still does not work unless fixed width and height are mentioned in style. In my app I used vw and vh as opposed fixed width and height to solve the problem of making it work on all screen sizes.
<div data-bind="koGrid: gridOptions"
style="height: 73vh;overflow:scroll;width: 96vw;"></div>

Gradually increasing line Raphael.js

I was wondering if it would be possible to draw a line in raphael.js that will gradually increase its width.
It would start with stroke-width of for example 2px, and finish with stroke-width of 10px.
Does anybody know how to do that?
Yes, it's quite straightforward. Given a Raphael paper element paper and path string pathstr, just do this:
var linepath = paper.path( pathstr ).attr( { stroke: 'black', fill: 'none', 'stroke-width': 2.0 } ).animate( { 'stroke-width': 10.0 }, 5000 );
Unless I'm missing something in your request, it really is that easy.

List paging in Sencha

I have created a list in Sencha touch2. I need to add paging to it. Lets say i need 25 items to be displayed in a page and on tap of "next" button, the next 25 items has to be displayed.
I believe sencha touch 2 provides paging but am not gettin a handle on it.
My code is
cls:'inboxqueuecls',
xtype:'list',
id:'queuelist',
store:'QueueStore',
plugins: [{
xclass: 'Ext.plugin.ListPaging',
autoPaging: false,
clearOnPageLoad: true
}],
style:{
'border-right':'0.01px black',
'background-color':'rgba(0,140,153,0.2)'
},
itemTpl:'{queueName}'
and my store is
pageSize: 20,
autoload: false,
proxy:{
type:'memory',
reader:{
type:'xml',
record:'string',
rootProperty:'QueuesNames',
}
}
but the "page size" doesn seem to be working.
Anything am missing? Please help.
As TDEBailleul has said pageSize is an attribute of store not of the proxy.
Second, Memory proxy does not support paging. MemoryProxy has its own processing in the Store.js. Specify json or other proxy to get paged ajax call at the output. Another solution is MemoryProxy or ever from other ancestor subclassing.