Hello,
Is this a problem with the 9 patch I'm using, is there an example app with a "good" 9 patch I can test against?
I'm trying to use a custom 9 patch for focusBitmapUri in a rowlist and seeing that every time the rowlist gets focus the first time, the selector is offset a bit to the left. Any navigation from there gets the selector in the correct position.
Trying to figure out what's going on here, I took the Example
Rowlist app, included my 9 patch and modified "rowlistscene.xml" like so:
<?xml version = "1.0" encoding = "utf-8" ?>
<!--********** Copyright 2016 Roku Corp. All Rights Reserved. **********-->
<component name = "RowListExample" extends = "Scene" initialFocus = "mybutton" >
<script type = "text/brightscript" >
<![CDATA[
sub init()
m.top.backgroundURI = "pkg:/images/rsgde_bg_hd.jpg"
m.rowlist = m.top.findNode("exampleRowList")
mybutton = m.top.findnode("mybutton")
mybutton.observeField("buttonSelected", "clicked")
m.rowlist.content = CreateObject("roSGNode", "RowListContent")
m.top.setFocus(true)
end sub
function clicked()
? " MyButton clicked :: setting focus on rowlist"
if m.rowlist = invalid then m.rowlist = m.top.getchild(1)
m.rowlist.setFocus(true)
end function
]]>
</script>
<children >
<Button id="mybutton" minwidth="300" height="100" text="click me" translation = "[ 130, 30 ]" />
<RowList
id = "exampleRowList"
translation = "[ 130, 160 ]"
itemComponentName = "RowListItem"
numRows = "4"
itemSize = "[ 1608, 308 ]"
rowItemSize = "[ [512, 288] ]"
rowItemSpacing = "[ [40, 0] ]"
itemSpacing = "[ 0, 40 ]"
showRowLabel = "[ true ]"
focusBitmapUri="pkg:/images/highlight_focus.9.png" />
</children>
</component>
and commented out the scaling in "rowlistitem.xml"
sub showfocus()
'scale = 1 + (m.top.focusPercent * 0.08)
'm.itemposter.scale = [scale, scale]
end sub
It has the exact same problem - on first focus to the rowlist, the custom focusBitmapUrl is offset to the left and any navigation corrects it.
Is this a problem with the 9 patch I'm using, is there something else going on? Any suggestions?tyvmiaJoe
aspiring