Same screen shown in different ways by the emulator and by smartphone

sejo

Member
Licensed User
Longtime User
Hi! I'm a beginner and I'm taking my first steps trying to create a new simple screen with different colours (background, or labels... ) that can be chosen (from a list) by the users.

I' ve got lots of questions about it:

1) How can i set the width of a label as "varying" depending upon his contents? (you may see it in the attached examples for the label "etichetta" )
2) I'm able to change the colours of a spinner only when i click on it (and appears a list)...
Is it possible to set only the colour of his text and not of his background?
Is it possible to set his colour also when it is unclicked?

3) Why is the edittext shown with a grey background instead of the usual white one? (see attached example named "smartphone")

4) Why are there these differences in what i see on the emulator and on a smartphone? The emulator I'm using is API 16 (4.1.2), on the smartphone is API 16 (4.1.1) and on the manifest, i can read this reference:
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="16"/>

5) I've also got a screen composed by two panels, both of them have a scrollview. The list at the bottom is being correctly shown on the emulator (I can regularly see all the items in it when it scrolls - see attached example named "emulatore") but not on the smartphone on which I get the last item truncated and the scrolling doesn't work properly! (see attached example named "smartphone")

Thank you in advance for your help and your patience!
I look forward to hearing from you!
 

Attachments

  • emulatore.jpg
    emulatore.jpg
    55.2 KB · Views: 228
  • smartphone.jpg
    smartphone.jpg
    62.8 KB · Views: 197

sejo

Member
Licensed User
Longtime User
Sorry but... I read the tutorial you suggest, but I wasn't able to find how to solve the problems I wrote you.
Can you suggest me other tutorial to read or help me suggesting what to do to in che cases mentioned before?
Thank you!
 
Upvote 0

sejo

Member
Licensed User
Longtime User
Only .bal file?
Ok.

Layout "colori" loads "colori_pannellodemo" into scrDemo.
scrColori contains a listview added by code...
 

Attachments

  • colori.bal
    1.7 KB · Views: 189
  • colori_pannellodemo.bal
    5.2 KB · Views: 166
Upvote 0

sejo

Member
Licensed User
Longtime User
I wrote this in the code

scrDemo.Width = 100%x
scrDemo.Height = 50%y
scrDemo.Top = 0

scrColori.Width = 100%x
scrColori.Height = 50%y
scrColori.Bottom = 100%y

and it seems to me the same thing you are suggesting me!
For the Listview, I didn't Know it! and i thank you very much!!!
Can you also give me a hint for the other questions??
Thank you so much for your precious answer!!
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
and it seems to me the same thing you are suggesting me!
Now I see that you are correct. Still my code is more clear (at least for me :) ).

Setting the label width to -2 (WRAP_CONTENT constant value) will make it increase its size as needed.

I think that the other questions are related to the different style used by your phone.
 
Upvote 0
Top