2016년 11월 16일 수요일

arrange items in listview


hi, i have this problem:
as you can see, this is a list that i create joining two values, the VALUE 1 before ":" and the VALUE 2 after ":"

no, since the two values are of different lenght, is it possible to arrange in a way that every value is in colum?

my ideas are:

1) split the two item in separated lists, and use two list views....the problem is to make a lookup in pairs maybe, and even if i want to delete or modify an element there will be  a problem
2) when i join the 2 values, i make something with length of words, so i can put the right length of space to make every values at the same distance

-- 

see this App Inventor Classic example http://stackoverflow.com/a/13309723/1545993
just convert it into App Inventor 2
or use 
Taifun

-- 
cool, i think it's the best solution
thanks


--
yes, i have some ideas
i'll keep the post updated


--
Do you have a fixed number of rows? If yes, you can create the columns with buttons, with no background, so they will look like clickable labels.

-- 
Not really, They are Very variable.
This evening i try to maKe something


--

just made this
the problem is that is still not alligned, maybe cause the different lenght of letters and "-"


tell me something :-(

-- 
Yes, unfortunately there's no monospace font for List Views or List Picker popups.

Fortunately, you only have two columns, which you can represent by:
TAG\n VALUEn

which would look like
------------
TAG
    VALUE
-------------

in the List View.

If you can't fix it, call it a feature.
This fits nicely in small cheap phones.

ABG

-- 
i was thinking to split TAG and TAGVALUE in two lists, i made it but the problem is that i cant scroll the two listview in the same time

-- 
There's an awkward way to combine an html label and a thin canvas into a ListView.

It's like a dog walking on two legs,
more like a bar bet.

ABG

-- 
seems interesting, for other stuff too 
thanx

-- 

found another approach

but he says "Segment: Start (1) + length (68.9375) - 1 exceeds text length (49).
Note: You will not see another error reported for 5 seconds."

?


-- 
Try rounding after you divide by 2.
And rename your procedure to dashes
ABG

-- 
rounded everything, but the same error

-- 
Time for Do Its on that segment operation.
Start from the right and work your way left.
Assign the x parameter temporarily into a new global temp_x in the procedure,
and use temp_x inside so you can apply the Do Its.
Parameters and locals evaporate before you can apply Do It to them.
Make it look like a pin cushion, then post it here.
For good measure, take the length of that long text, and compare it against the desired segment length.before you do the segment operation.
It's very finicky.
ABG

-- 
alas, 
look at that (hope i did not misunderstood the global temp_x)
-- 
See attached for how to inject a global variable into a value procedure for debugging.
After coding all the blocks, I started AIStarter, connected to the Emulator,
waited for it to warm up, then ran Do It on the call block.
This primed the global trace variable with the last x value, so
I could right-click-do-it inside the multiply block and in its parameters.

I see your comment bubbles are empty.
do_it.png 표시 중
Don't add comments to the blocks you want to trace; do-it adds them and fills them in.ABG


-- 
P.S.  I left a typo in my math to help show how Do It helps trace values.
Really.

ABG

-- 
JUST MADE IT!!!
it's not so precise, but it doesn't matter!!
NOW TELL ME THAT I'M SMART, i lot 7-8 hours of my life for that

as you can see, itworks even if the elements have a lenght > than listpicker width
maybe tomorrow i'll try to think a possibility when element have to go in 3 rows

-- 
i could i change the color of "TagName"? 

-- 
to make it easier i made lke you said, \n

it really good now, the problem is that if the second value (TAG VALUE) is too long, when he goes to another string it starts from the beginnins of the listpicker, on the left, and it'ìs not alligned to the first string, as you see in the 7th element

suggestion? not so important, but could be cool

-- 

댓글 없음:

댓글 쓰기