I have an FMX Android project compiled with Delphi 10.1 Berlin. The user needs to select from 19 values to run it and I use a TPopupBox component to display 19 TRadioButtons that show in 3 columns of 7+7+5 buttons for that selection.
The default is for a transparent popup window which is useless, so I edited the style to add a white TRectangle to the background of the popup window which works, but only if I size the rectangle to match the size of the popup. Aligning the rectangle to client or contents only sets an opaque background to the first row of radio buttons. I have 2 questions:
How can I auto size the rectangle rather than fixing it at design time to match what I calculate will be set for popup.bounds?
Is adding a TRectangle to the style background the best way to get an opaque control?
I have tried all obvious align options and searched the internet. Somebody suggested deleting 'background' from the style list but that did not work. Somebody else suggested editing the manifest but my manifest just gets overwritten when I compile.
I believe you wrote erroneously TPopupBox and probably meant to write TPopup. That is anyway what you should use for popup windows.
You may want to create a new project, for testing purposes. Add a button near top left. This will show and hide the popup window.
Add a TPopup and size it as you wish, and set Visible := True.
Add a rectangle inside the popup and set its Align property to Contents. Set its Fill.Color property as you wish. Add TRadiobuttons as you wish, on the rectangle.
Finally, the code to toggle the popup visibility (but see notes in Help):
Popup1.IsOpen := not Popup1.IsOpen;
Please note! There are many properties that jointly affect the placement of the TPopup: Placement, PlacementRectangle, PlacementTarget. As I don't know your needs, I leave it to you to decide what to use.
A sample test case:
Here PlacementTarget is Button1 and Placement is Bottom.
Related
i wanted to create a popup action menu for this fab.i used the quick action GitHub library but this is not coming centrally aligned.how to align it centrally.
https://github.com/piruin/quickaction
You must first import the library into your project.
https://github.com/piruin/quickaction/blob/master/quickaction/src/main/res/layout/quick_action_horizontal.xml
if you set the width value of HorizontalScrollView here to match_parent, you get the look you want. If you also leave a space around the edges (android: layout_marginHorizontal = "40dp") the design you want will appear. Of course, apart from what I wrote, you should adjust your own corrections.
Every TextView, Button and control that I drop into the blueprint view goes to the upper left corner. I have seen demos that show people dropping controls in and they all go in right below the previous control and it allows them to be resized, center, or any other setting applied. I have been able to adjust properties of each control to make them visible, but I have to do it in the text mode of the XML file. I'm new to android dev so I don't know all of the properties for the controls yet. This doesn't seem to work for me. Is there a default setting that needs changed to allow controls to be placed where I put them??This is extremely frustrating.
I am trying to find the color code for the bright light blue color used by the Android framework in some of their widgets. I understand that the framework uses 9 patch images to draw these widgets, so the color code would theoretically not be stored in the framework code.
But is there a way to find what was the color code used in the SeekBar or the ToggleButton(the small blue line when Checked)?
I generally use #33B5E5 for the color.
Take a screenshot of the image and upload it to this site and click the color you want to know about.
http://html-color-codes.info/colors-from-image/
In Android-Studio you can do it in the Program itself too. To do that, follow this steps:
Put the Item in your view that you wish to know the color from or have a picture or screenshot ready and open on the PC
Select an item (Button, View, etc) in the "Component-Tree" on right side and go to the "Color-Property" or the prop "Backgroud" of the selected item (one has to be in Design-Mode to see the Component-Tree).
Then click the "..." behind the Property-Edittextfield and a menu opens up where you can choose a color, by either go to the System-Tab and choose a predefined Android-System Color (you see all the different greens here for example). After select a color you see the value of it in the value window below.
You can also go to the Color-Tab and click the little color-selector item, then hover it over the Layout-item that you draged to the view in step 1 and try to hover the spot where the needed color is. You can have also a screenshot open, or the android emulator or something. The color-picker lets you hover also over outside program views, not only insde Androidstudio.
Voila, there you have all system colors.
Hi I would like to know is it possible to make a memo transparent? If so, how is it done? I want the user to be able to see the text displaced as well as the background image instead of the just the white background of the memo.
I'm using Embarcadero RAD Studio XE5
Thank you
Just set the Opacity property to a value lower than 1. I haven't tested this component for Android but buttons, toolbars, images, etc. do work. I tested the TMemo for windows and that too works.
I have XE2, so editing the style may be a little different in XE5. In XE2, you can right-click the TMemo and choose "Edit Custom Style..." from the popup menu.
Find the style for the memo (not the scroll bar), then expand the style down to the background TRectangle.
Set the Fill color and the stroke color for the TRectangle to Null, then click the "Apply and Close" button, and the TMemo will now be "Transparent".
If the steps are different for editing the style in XE5, please let us know. Also, if this isn't what you're looking for, please provide an image demonstrating what you're going for.
I have an update for my app that includes ActionBarSherlock with a sliding menu. I have put my navigation entirely in to the sliding menu, leaving my main_activity pretty bare. I am worried the user won't know about the menu. So I want to add a prompt at start-up that will highlight the new feature. Like this:
I am not even sure what this is called, so I don't know how to research it. Any help or suggestions will be rewarded. Thanks!
You could just use overlay layout (Frame layout with multiple inner layouts will fit perfectly. Please note Frame Layout Z axis is by the lower the layout is in the xml, so the guide should be the last in the XML). Make that layout's background mostly transparent and add buttons and design to fit your needs. When you don't want to show the layout just set visibility to gone. And when you need it set to visible.