I have created a layout that has xml files, these xml files are joined by "include" to make one layout in hdpi.I have texts in these files. I have given size for the text in dp. However, when i run the app in smartphone with mdpi screens, my layout heigh can not fit the screens. My layout's not resizing. Please help me with this question
Related
I have an app which has multiple themes, some of them are "light" themes and some are "dark".
In my actionbar I have mutiple icons, which I've downloaded as PNGs from Google's material icons website.
Questions:
How do I change them to be black/white according to the theme?
If the answer is to use vectors, how still do I make them change color? Would vector icons affect performance?
I used a layout for different resolutions but it did not look good. So I want to know how to make different layouts for different resolutions.
Mr Aks, you are supposed to create different folders for each resolution, in the resources' folder. The location will be something like this, C:\Users\Username\AndroidStudioProjects\Appname\app\src\main\res. The folder names you can keep will be:
layout (layout for normal screen size)
layout-small (layout for small screen size)
layout-large (layout for large screen size)
layout-xlarge (layout for extra large screen size).
If you need more help than you can write more questions, I will answer them.
Just started working with this awesome external but have a couple of questions.
When the control is evoked, is it always the top layer or can I have a background transparent image on top of it so I can frame the control nicely?
Also, my testing seems to read most Barcodes but when it comes down to reading Barcodes on hard drives, the control does not want to decode those.... Too dense of bar code pattern?
I am very impressed thus far with the ease of use of your externals. Makes we want to code more for mobile devices!
an overlaying transparent image is not possible, as far as i know.
but couldnĀ“t you use
command mergZXingControlSetRect pLeft,pTop,pRight,pBottom
to define the rect of that scanner after creation
or
command mergZXingControlCreate pLeft,pTop,pRight,pBottom
to create the scanner control in the specified rect.
Set the rect smaller than the width and the height of the screen.
You could then use an underlying image, which is displayed outside of the scanner rect, to show the frame around scanner control. Did not test it myself, but i would assume that this should work.
Unfortunately the native controls in externals and the ones the engine provides are added as views on top of the LiveCode view. That means you can't intermingle LiveCode controls with them. One thing that some users have done is add a web view with a transparent background and a load a png image. If you create the barcode view first and the web view second then the web view will be on top.
i give you simple example. I have liner layout and simple 3 buttons. For fill linearlayout by 3 buttons I use weight (1,1,1,). Butonts resizes. Its OK.
But when I have buttons which consist from 3 shape (rectangle, rectangle, oval).
On tablet: Oval is resized to elipse
on mini smart phone Oval is missing.
I know Shape is defined by dip, but i dont know how make Gui for more resolution.
3 xml to each resolution???
You may want to take a look at the answer to this StackOverflow question.
StackOverflow - Android screen size HDPI, LDPI, MDPI
It links to the Android developer guide relating to screen sizes.
Initially I developed my application for phones only in portrait mode. But now, I want to shift that to tablets as well, but in portrait mode only. My question is, can we define different layouts for portrait mode for different screen sizes. It works on tablets but the UI is stretched. If yes, how..? If someone could give an example.
Yes you can define the same layout for different sized devices.
Assuming you have the layout folder already, you can create another one called 'layout-xlarge'.
In here, create an xml layout with the same name as the one in the layout folder. Now when you run the app, only 10" tablets (devices designated as having extra large screens) will use the 'layout-xlarge' folder.
All other smaller devices will use the 'layout' folder.
Your folder structure will look like so:
res/layout/my_layout.xml // layout for normal screen size ("default")
res/layout-xlarge/my_layout.xml // layout for extra large screen size
You can do the same for small and large screens, among others.
This is a rather brief description and you would do well to read this when you get a chance:
http://developer.android.com/guide/practices/screens_support.html
i think you have to create 3 layout in your resource folder and each one has same name xml file
that are
layout (contaning a.xml, b.xml, c.xml)
layout-large (also contaning a.xml, b.xml, c.xml)
layout-small (also contaning a.xml, b.xml, c.xml)
check your application on different size of emulators like QVGA, HVGA, etc.
Yes you can develop define different layouts for portrait mode for different screen sizes
res/layout/my_layout.xml // layout for normal screen size ("default")
res/layout-small/my_layout.xml // layout for small screen size
res/layout-large/my_layout.xml // layout for large screen size
res/layout-xlarge/my_layout.xml // layout for extra large screen size
res/layout-xlarge-land/my_layout.xml // layout for extra large screen size for land scale
by default res/layout/my_layout.xml this means you are going to create my_layout for portrait mode.
just take care of folder hierarchy .
for more details