Hi,
I have an screen where i have placed a button(M) at the right of the screen so i want the pop up menu arrow to come from the left of the button.
is it possible to do it. kindly let me know how i can go about it.
PFA the image of the screen
Hi Erel,A better solution using Reflection library:
B4X:Sub ListView1_ItemClick (Position As Int, Value As Object) ac1.Show(GetViewAtPos(Sender, Position)) End Sub Sub GetViewAtPos(LV As ListView, Position As Int) As View Dim r As Reflector Dim v As View r.Target = LV Dim first As Int first = r.RunMethod("getFirstVisiblePosition") v = r.RunMethod2("getChildAt", Position - first, "java.lang.int") Return v End Sub
How is this code related to a WebView?
Thank you corwin42, I'll try looking into the *.xml file.menu items font can only be changed in the xml layout files for the item.
different fonts and sizes are not possible directly. Maybe it is possible with reflection library but I haven't looked into it.
<TextView
android: id = "@ + id / tv_title"
android: layout_width = "fill_parent"
android: layout_height = "fill_parent"
android: gravity = "center_vertical"
android: paddingLeft = "5dip"
android: paddingRight = "10dip"
android: text = "Chart"
android: textsize = "24DIP"
android: textColor = "#000" />
I've done it!
Leave these instructions if you can be of help to some other partner:
Ahqa_action_item_vertical.xml file that is inside the folder objetcs / res / layout we serve to change the size and color of the text.
B4X:<TextView android: id = "@ + id / tv_title" android: layout_width = "fill_parent" android: layout_height = "fill_parent" android: gravity = "center_vertical" android: paddingLeft = "5dip" android: paddingRight = "10dip" android: text = "Chart" android: textsize = "24DIP" android: textColor = "#000" />
I have put 24DIP and text color I put in black.
Then you have to vary the ahqa3d_popup.9 arhivo this within the Objects folder / res / drawable. Currently this a square black (to my understanding very ugly), I've changed by another the other with a gradient. Keep in mind that this file is a 9.png and therefore have to work previously with some NinePatch retouching tool.
If you do not like the small triangle that appears below the dropdown, you can edit the png file and completely remove ahqa3d_arrow_down/ahqa3d_arrow_up, leaving only the transparent square area. I think this could also be achieved by modifying some other xml, but honestly, after so many hours spent on these small details rather not see more xml in a while ... Do you know how hard it is to use the translator of google for all!
After changing all the comments, and have put VERY IMPORTANT READ ONLY files, you have to clean the project and run it so you can see the difference.
I hope I have said no nonsense, and if I did, I hope the author of this magnificent library knows forgive.
Thank you all!
I think it is dp for xml layouts and not dip. Fonts should be specified with sp.
You can create different layout folders for different screen sizes. See here how it is done with XML.
So create a layout-sw600dp folder and put the ahqa_action_item_vertical.xml file there and change the textsize in this file. On a phone the xml-file from the normal layout folder will be used. On a tablet the xml file from the layout-sw600dp folder will be used. You only need to copy the xml files to the layout-sw600dp folder which differ from the default file.
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?