GWT date picker scroll issue - css

I am using GWT datepicker in my web page .When i am adding in the bottem of the page its
behaviour is quite abnormal as shown in the snap shot .
I tried with z-index and with some known css properties .But i did'nt cameout from the digg.
Any other css or date picker properties will resolve this ??

I got the solution for this
dateIcon.addClickHandler(new ClickHandler()
{
#Override
public void onClick(ClickEvent event)
{
int left = dateIcon.getAbsoluteLeft() + 30;
int top = dateIcon.getAbsoluteTop() + 10;
if(dateIcon.getAbsoluteTop()+400>Window.getClientHeight()){
top = dateIcon.getAbsoluteTop()-200;
}
popUp.setPopupPosition(left, top);
if (isControlEnabled())
![enter image description here][2] {
popUp.show();
} else
{
popUp.hide();
}
}
});

Related

SetIcon change color

Hello i am trying to set icon of bottom nav bar
Icon
But everytime it changes color of whole icon and then it look like this
Icon
Is it possible to not give icon color so it wont change whole icon?
You could try to use the custom renderer to the set the icon. And set the ItemIconTintList to null.
[assembly: ExportRenderer(typeof(AppShell), typeof(ShellCustomRenderer))]
namespace App_Shell.Droid
{
class ShellCustomRenderer : ShellRenderer
{
public ShellCustomRenderer(Context context) : base(context)
{
}
protected override IShellBottomNavViewAppearanceTracker CreateBottomNavViewAppearanceTracker(ShellItem shellItem)
{
return new CustomBottomNavAppearance();
}
}
public class CustomBottomNavAppearance : IShellBottomNavViewAppearanceTracker
{
public void Dispose()
{
}
public void ResetAppearance(BottomNavigationView bottomView)
{
}
public void SetAppearance(BottomNavigationView bottomView, IShellAppearanceElement appearance)
{
bottomView.ItemIconTintList = null;
IMenu myMenu = bottomView.Menu;
IMenuItem myItemOne = myMenu.GetItem(0);
if (myItemOne.IsChecked)
{
myItemOne.SetIcon(Resource.Drawable.cactus_24px); // selected icon
}
else
{
myItemOne.SetIcon(Resource.Drawable.icon_about); //default icon
}
}
}
}
Update:
If you want to change the burger icon of shell, you could use Custom renderer to reset the icon vis CreateToolbarAppearanceTracker.
For more details, you could refer to the thread i done before. How to hide back button in navigation bar using Xamarin.Forms - AppShell?
If you want to change the back button color of navigation bar, you could set in style. Please check the link below. Change back button color in Xamarin.Android

Xamarin Forms UWP specifying button width request with an effect

I would like to specify the width of a Xamarin.Forms.Button with an effect in UWP, something like:
protected override void OnAttached()
{
if (VisualElement is Xamarin.Forms.Button buttonControl)
{
buttonControl.WidthRequest = 40;
buttonControl.BorderWidth = 1;
}
}
VisualElement is an invalid type. What goes in its place? Thank you!
Xamarin Forms UWP specifying button width request with an effect
In Xamarin effect class, the attached control is referenced with Element property but not VisualElement, please edit your code like the following and you will get forms button on OnAttached method.
protected override void OnAttached()
{
if (Element is Xamarin.Forms.Button buttonControl)
{
buttonControl.WidthRequest = 40;
buttonControl.BorderWidth = 1;
}
}

HOWTO: Manipulate Back Arrow Icon and Button on Navigation Bar (Xamarin Forms / Android)

I am attempting to change the size of the back arrow in the navigation bar.
Using information from this article, I have added the following code:
protected override Task<bool> OnPushAsync(Page view, bool animated)
{
var result = base.OnPushAsync(view, animated);
var activity = (Activity) Context;
var toolbar = activity.FindViewById<Toolbar>(Resource.Id.toolbar);
if (toolbar != null)
{
if (toolbar.NavigationIcon != null)
{
if (toolbar.NavigationIcon is DrawerArrowDrawable navigationIcon)
{
// Code goes here?
}
}
}
return result;
}
If this is indeed the correct path, what code goes in the area marked by the comment "Code goes here?"?
* UPDATE *
I realized that what I am trying to figure out was not exactly described in my original question.
More specifically, when I mentioned that I am trying to resize the navigation bar back arrow, what I am really trying to do is to resize the button that the icon appears on.
For example, if I shrink the height of the navigation bar using code like the following:
On<Android>().SetBarHeight(100);
The button that the icon appears on will be clipped.
Ultimately, what I am trying to accomplish is resizing the icon AND the button that the icon appears on. I have already figured out how to do the former.
I am attempting to change the size of the back arrow in the navigation bar.
If you want to change size of the back button in the navigation bar, you can get new icon from Drawable in resource for toolbar.NavigationIcon.
public class NavigationPageRenderer : Xamarin.Forms.Platform.Android.AppCompat.NavigationPageRenderer
{
public AppCompToolbar toolbar;
public Activity context;
protected override Task<bool> OnPushAsync(Page view, bool animated)
{
var retVal = base.OnPushAsync(view, animated);
context = (Activity)Forms.Context;
toolbar = context.FindViewById<AppCompToolbar>(Droid.Resource.Id.toolbar);
if (toolbar != null)
{
if (toolbar.NavigationIcon != null)
{
if (toolbar.NavigationIcon is DrawerArrowDrawable navigationIcon)
{
// Code goes here?
toolbar.NavigationIcon = Android.Support.V7.Content.Res.AppCompatResources.GetDrawable(context, Resource.Drawable.back);
toolbar.Title = "Back";
}
}
}
return retVal;
}
}
Here is the sample you can take a look:
https://github.com/hachi1030-Allen/XamarinCustomNavBar
<NavigationPage.TitleView> will help you out there. This is a XAML approach.
Example:
<NavigationPage.TitleView>
<StackLayout>
....
</StackLayout>
</NavigationPage.TitleView>
Using this approach you will be able to set HeightRequest and WidthRequest of whatever element you place inside the StackLayout and whatever else you want to amend.
Also, note that if you are having icon size problems it may be worth looking into whether or not your drawable/ icons are the right size for the right resolution.

Xamarin Forms Orientation on iPad

I have a Universal Xamarin Forms App with a single page wrapped in a NavigationPage:
Current.MainPage = new NavigationPage(new RootPage()
{
BackgroundColor = (Color)Application.Current.Resources["BackgroundColour"]
})
{
BackgroundColor = (Color)Application.Current.Resources["BackgroundColour"],
BarBackgroundColor = (Color)Application.Current.Resources["BackgroundColour"],
Padding = NavigationPaddingForPlatfrom()
};
I've also overridden GetSupportedInterfaceOrientations in AppDelegate and set a break point - however the break point is never hit. When I rotate in the simulator or device, the break point isn't hit. I've also set the Device Orientation in info.plist to Portrait only, however the App still rotates.
Am I missing some configuration point that's needed to control orientation?
I'm using Xamarin Forms 2.4.0.38779.
The end goal is to force a MasterDetail Page into landscape only.
For forcing exact mode this code worked for me:
public MainPage()
{
InitializeComponent();
OnOrientationChanged += OnOrientationChange;
OnOrientationChange(this, new OrientationChangedEventArgs(DeviceOrientation.Landscape));
}
private void OnOrientationChange(object sender, OrientationChangedEventArgs e)
{
IOrientationService orientationService = DependencyService.Get<IOrientationService>();
DeviceOrientation currentOrientation = orientationService.GetCurrentOrientation();
if (currentOrientation != DeviceOrientation.Landscape)
{
orientationService.SetCurrentOrientation(DeviceOrientation.Landscape);
}
}
Have you tried this.
protected override void OnSizeAllocated(double width, double height)
{
base.OnSizeAllocated(width, height);
if (width != this.width || height != this.height)
{
this.width = width;
this.height = height;
if (Width > Height)
{
//your grid
}
else
{
//your grid
}
}
}
After reading a lot of article and forum posts, I came across this:
https://forums.xamarin.com/discussion/79389/how-to-lock-orientation-in-landscape-for-an-ipad-only-app
The last post by JoeRaco references this SO post:
Xcode 7 ERROR ITMS-90474: "Invalid Bundle", can't submit to Apple
Without 'Requires full screen' set to true, GetSupportedInterfaceOrientations was not being called in AppDelegate. Therefore adding the following to the info.plist solved my problem:
<key>UIRequiresFullScreen</key>
<true/>

Javafx Disable Scrolling by Mousewheel in ScrollPane

Does anayone know how to disable scrolling by Mousewheel in a ScrollPane?
The following works for me:
scrollPane.addEventFilter(ScrollEvent.ANY, new EventHandler<ScrollEvent>() {
#Override
public void handle(ScrollEvent event) {
if (event.getDeltaY() > 0) {
zoomIn();
} else {
zoomOut();
}
event.consume();
}});
You may find that you also need something like the following:
scrollPane.setOnScroll(new EventHandler<ScrollEvent>() {
#Override
public void handle(ScrollEvent event) {
if (event.getDeltaY() > 0) {
zoomIn();
} else {
zoomOut();
}
event.consume();
}
});
I added the above elaboration to another answer in this thread, but it hasn't shown up in the public feed from what I can tell. So, I've pasted it in its own answer.
This question is a bit of a duplicate, but it showed up in Google for me first, so I'm answering it. The inspiration for the above is:
Zooming in JavaFx: ScrollEvent is consumed when content size exceeds ScrollPane viewport
I think there is no direct solution.
So I would add an event filter to the ScrollPane for the SCROLL EventType and consume every event. That should prevent any mouse generated scroll events from being delegated to the ScrollPane.

Resources