I have a regular TButton on a firemonkey form. In the form's FormShow event I adjust the button width with the following line of code:
Button1->Width = Form1->ClientWidth * 0.8;
The button shows up fine on iOS and is sized properly. On Android the button just doesn't show up. I changed my code to the following and it works fine on Android (and iOS).
Button1->Width = Screen->Width * 0.8;
I'd like to understand why the first line of code doesn't work on Android. Note, if i use either line of code in the form's FormPaint event it works fine. Obviously this isn't urgent - i'd just like to know why the first line of code fails in FormShow.
Related
I am using RadListView and I am trying to scroll to the bottom of the list. It works great on Android and iOS until I add a header to the RadList. Once I add a header on Android it will scroll to the second to the last item, not all the way down.
See playground example here.
I have updated the playground here.
If you change it to
this.radList.scrollToIndex(this._dataItems.length - 1, false, ListViewItemSnapMode.Auto);
or
this.radList.scrollToIndex(this._dataItems.length - 1, false);
It works fine on both android and ios. ListViewItemSnapMode.Auto : The target item is snapped at the closest possible position which makes it clearly visible.
I've got a Label (#1) and on top of it (and wider and transparent background) I have another label (#2).
I've got a tap event callback set for label #1.
In iOS, it seems like the top label is not passing the tap to the bottom Label - even though there's no tap event set for Label #2.
I set label2.isUserInteractionEnabled to false but no help.
On Android, the pass-thru works fine.
Help appreciated.
Setting label2.isUserInteractionEnabled to false on the top Label element works as advertised.
I'm trying to realize this layout in android wear: Timer Custom App. I think this is like a listview with horizontal orientation, but WearableListView doesn't have this attribute.
Try using a GridViewPager and setting negative page margins :
pager = (GridViewPager) stub.findViewById(R.id.fragment_container);
pager.setPageMargins(0, -30);
You can then implement onClick listeners on the fragments to change the current page by just clicking at the right or left of the page like the native alarm app.
I'm developing a Windows Phone application. When I launch, the splash screen is shown very shortly, and the MainPage.xaml is shown. However, in the MainPage, I setup the camera with the usual code:
if (PhotoCamera.IsCameraTypeSupported(CameraType.Primary))
{
_photoCamera.Initialized += OnCameraInitialized;
// And other event handling
viewfinderBrush.SetSource(_photoCamera);
}
This is simplified, but it all works. My problem is that this takes a while (mabye 0.5 - 1 seconds, I didn't time it exactly).
So what my user gets is a splashscreen that's so fast, he/she can't see it; and a first page that takes just that tiny fraction to experience it as slightly laggy/slow.
I'd like to change it. Have the splashscreen show until everything is initialized. This has the added benefit of branding for me, and a nice experience for the user.
I've tried this:
Add my splashscreen as image into my MainPage, on top of everything else and hide it when everything is initialized
Add my splashscreen in a popup on my MainPage, and hide the popup when everything is initialized (found that here)
This 'works', but I can see a black flash between the splashscreen and my image/popup. Is there a way to make this transition seamless? Or is this fairly normal behavior in WP7?
Your first option should work - but understand that in one trip through a UI-thread method, the UI doesn't actually update until all the code is executed. So break it up into pieces.
1) Load your MainPage.xaml, which has the splash image filling the screen by default
2) Add an event handler for both OnNavigatedTo and LayoutUpdated. When OnNavigatedTo is hit, set a flag to true. In LayoutUpdated, check for that flag to be true, set the flag to false, then run a Dispatcher.Invoke() call on the method you described above.
3) Remove the image or set it to collapsed after that method is completed.
I'm trying to change the background color of the modal-popup in a google SpreadsheetApp built with on GUI. .setStyleAttribute() does not seem to work here. I've also tried to set the style after the GUI component is loaded - no dice.
var app = UiApp.createApplication().setHeight("400") // - works fine, height of modal-dialog is pushed by UiApp height
.setStyleAttribute("background", "black"); // works for Ui element - not for outermost modal-dialog
//load the GUI component
app.add(app.loadComponent("GradeChallengesGUI"));
Perhaps it is not possible to change the background of the modal-dialog? Elements nested underneath are easily modified. I just can't get to the top parent of the UI. At this point, I'm assuming this isn't possible?
Could add everything to a panel type, set bg of the panel, add it to the app.
As you're loading the UI you've created in GUI Builder you can set the background color right there. Choose the top component and set the background color property.
If you prefer code you can do something like this:
app.getElementById("Component1").setStyleAttribute("background", "black");
"Component1" is a default ID for the first top element in GUI Builder.