how can i make an item take up 50% of the screen's width using xml? more specifically a checkbox.
thanks
Related
I want to develop an app that puts a white line grid on a black background.
The grid has 3 columns and 3 rows
There is a 10% border around the grid.
The first column takes up 50% width
The second column takes up 20% width
And the third column takes 10%width
None of the columns expand or contract, they always stay the same size.
Each row is the same height.
If you click any cell, a keyboard appears on the screen allowing you to input data into the cell.
Is it possible to do this white line grid in Android?
If yes, how does one do it?
Best regards
RedTopBox.com
anyone know
Hi All
i have not received any replies.
Can anyone help please
I think it is possible. Do you have a fixed number of rows? is it small? if yes, you could directly use LinearLayout with orientation set to horizontal for each row. There you have android:layout_weight which you can use to play with the different widths you have. For the table borders, just add a View, with a background color of your preference, again use layout_weight if necessary.
If you have too many rows, or you would prefer another approach, you could use TableLayout, and for each row a TableRow, and in the same way use layout_weight for the width. For drawing the borders you could do it in this way: http://www.droidnova.com/display-borders-in-tablelayout,112.html
TableLayout has different parameters like shrinkColumns, or stretchColumns, which you will probably would need, but I am no expert on this, so you would need to play with them.
For displaying a keyboard when the user press on each element of the table, you could have a editText on each, so this would be automatically.
BTW I recommend you asking this type of questions in stackoverflow.com, and tag it with android, there should be more capable people than me to help you with this particular case.
hello, I have a gridview that uses fill_parent, it will always have 7*6 cells.
now i try to get the cells to stretch so all the cells is the max size as possible without getting any scrolling!
the width is right but I dont know how to get the right height on each cell....
I tried using getHeight() on the grid and then take height/6 but getHeight() returns 0 as height and I think thats because it uses fill_parent so how can i do this?
When I draw, no matter what the pen size, the rendering seems to be a bit fuzzy/blurry. Like while I'm writing (pen is on the screen), the trail that my pen leaves behind looks fine (very smooth and vector-ish) but as soon as I let go, what I've written renders into this slightly blurry thing and it's kind of driving me nuts. I'm at 100% zoom with pressure sensitivity enabled, blue/black pen on a white background.
Any ideas?
@abmicyau: I guess you have choose a rather small width and height of your notebook pages. When you click on the `?´ aside the parameters when creating a new notebook, LectureNotes will give recommendations. For instance, a width of 1280 and a height of 1811 (yielding an A4 aspect ratio) is a good choice.
acadoid said:
@abmicyau: I guess you have choose a rather small width and height of your notebook pages. When you click on the `?´ aside the parameters when creating a new notebook, LectureNotes will give recommendations. For instance, a width of 1280 and a height of 1811 (yielding an A4 aspect ratio) is a good choice.
Click to expand...
Click to collapse
That is the default setting - it's what I have for mine. The only way i can really fix it is if I set the width to be a bit higher, then increase the default magnification.
I know the nexus10 has a 2560x1600 Resolution but that includes the Softkeybar (Home, Back, Options) which we cant hide. We need the "real" usabable resolution so we dont get on trouble with image cropping etc.
Does anybody know exactly how high the Softkeybar on the Nexus10 is or what the "real" usable Resolution for the Nexus10 is? I googled already but cant find any usefull information.
Would be great to hear something from you guys.
Best regards
Philipp
Just a thought... take a screenshot. If it's less than 1600px high... minus the amount from 1600.
all screenshots i can find are 2560x1600. So that doesnt really help
I think it's 42dip.
for xxhdpi the ratio is about 1:3... So that would be about 126px (42px x 3).
EDIT:
Yep, this should help:
http://stackoverflow.com/questions/8168329/android-screen-sizes-in-pixels-for-ldpi-mdpi-hpdi
Kryten2k35 said:
I think it's 42dip.
for xxhdpi the ratio is about 1:3... So that would be about 126px (42px x 3).
EDIT:
Yep, this should help:
hm that confuses me. I measured it in photoshop on a 2560x1600 Screen shot and it was 96px. But i wanted to make sure so i hoped for some official info about that.
The DP stuff will be important when choosing sizes for UI Elementes but isnt relevant for the whole "whats resolution to work for" problem.
Isnt there any official Info about how many pixel of the screen height (in landscape mode) i loose to the Softkeybar?
Click to expand...
Click to collapse
mitsubstanz said:
Kryten2k35 said:
I think it's 42dip.
for xxhdpi the ratio is about 1:3... So that would be about 126px (42px x 3).
EDIT:
Yep, this should help:
hm that confuses me. I measured it in photoshop on a 2560x1600 Screen shot and it was 96px. But i wanted to make sure so i hoped for some official info about that.
The DP stuff will be important when choosing sizes for UI Elementes but isnt relevant for the whole "whats resolution to work for" problem.
Isnt there any official Info about how many pixel of the screen height (in landscape mode) i loose to the Softkeybar?
Click to expand...
Click to collapse
This guide has some of the basic info for density calculations.
http://developer.android.com/guide/practices/screens_support.html
The value will be different depending on the device's current screen density, but below are the default calculations for the Nexus 10:
The navigation bar height is defined in framework-res as 48dp.
The device's screen density is defined in build.prop as 320.
The density ratio (screen density / android default density of 160) is 2.
48 * 2 = 96px so your measurement in photoshop is right.
You can also visually check using Settings > Developer options > Input subsection > Pointer location
Click to expand...
Click to collapse
I just come back to say yeah it was 48dp. I had changed mine using AOKP to 42dp.
The above post is good info.
I don`t use navigation bar or the notififcation bar.
On aokp roms i hide them with gmd gesture control. Very easy to navigate with gestures and have the whole screen real-estate to apps.
I dropped my phone. Now, one strip of the screen (where the address bar in Chrome is) is no longer responsive to my touch.
I've come up with a workaround: using Nomone resolution changer to lower the screen height to avoid the problematic screen parts.
This is not ideal because the app removes screen size from both the top and the bottom, so I waste valuable screen real estate. Is there any app or any way I can adjust the screen height from only the top and not the bottom? Alternatively, feel free to suggest other workarounds
tongrhj said:
I dropped my phone. Now, one strip of the screen (where the address bar in Chrome is) is no longer responsive to my touch.
I've come up with a workaround: using Nomone resolution changer to lower the screen height to avoid the problematic screen parts.
This is not ideal because the app removes screen size from both the top and the bottom, so I waste valuable screen real estate. Is there any app or any way I can adjust the screen height from only the top and not the bottom? Alternatively, feel free to suggest other workarounds
Click to expand...
Click to collapse
You can change system DPI in build.prop.