-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Grid use #10
Comments
@jjgarrett0 as long as P.S. @jjgarrett0 so have you managed to make P.P.S. I have no relations to the team or author of |
@jjgarrett0 experimenting with
P.S. Not sure whether the control can handle non-monotonic (unsorted) array of such states properly. [UPD] did not quite work with the |
My xaml just in case: <ContentPage.Content>
<Grid BackgroundColor="Gray"
HorizontalOptions="Fill"
VerticalOptions="Fill"
RowSpacing="0"
ColumnSpacing="0"
Padding="0"
Margin="0">
<Grid.RowDefinitions>
<RowDefinition Height="48" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<!--
primary contents of the screen
to be here
-->
<slidingdrawer:BottomDrawer Grid.Row="0" Grid.RowSpan="2"
x:Name="BottomDrawerView"
LockStates="{
Binding Path=LockStatesForSlidingBottomDrawer
, Source={x:Reference MapTabRootViewPage}
}"
IsExpanded="{
Binding IsStationInfoPopoverVisible
, Mode=TwoWay
}"
IsVisible="{
Binding IsStationInfoPopoverVisible
, Mode=OneWay
}"
ExpandedPercentage="{
Binding ExpandedPercentage
, Mode=TwoWay
}"
HorizontalOptions="Fill"
VerticalOptions="End"
CornerRadius="16"
Padding="0"
Margin="0" >
<StackLayout Orientation="Vertical"
x:Name="BottomDrawerStack"
Spacing="0"
Padding="0"
Margin="0">
<!-- Slider top indicator for dragging -->
<BoxView BackgroundColor="#C7C7CC"
WidthRequest="32"
HeightRequest="3"
HorizontalOptions="Center"
Margin="15,22" />
<station:StationInfoBriefFragment
BindingContext="{Binding StationBriefPopoverContext}"
HorizontalOptions="Fill"
Margin="0"/>
</StackLayout>
</slidingdrawer:BottomDrawer>
</Grid>
</ContentPage.Content> |
@jjgarrett0 so I've figured out that proper bottom positioning is achieved by that magical Line 64 in 81eef2e
RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent,
Property=Height,
Factor=1,
Constant=-65}"> Which means The same positioning can be achieved within a <slidingdrawer:BottomDrawer Grid.Row="0" Grid.RowSpan="2"
x:Name="BottomDrawerView"
LockStates="{
Binding Path=LockStatesForSlidingBottomDrawer
, Source={x:Reference MapTabRootViewPage}
}"
IsExpanded="{
Binding IsStationInfoPopoverVisible
, Mode=TwoWay
}"
IsVisible="true"
ExpandedPercentage="{
Binding ExpandedPercentage
, Mode=TwoWay
}"
CornerRadius="16"
HorizontalOptions="Fill"
>>> VerticalOptions="Start"
Padding="0"
>>> Margin="{
Binding Path=BottomDrawerVerticalOffset
, Source={x:Reference MapTabRootViewPage}
}"> Still, that "large offset" has to be calculated manually (or I just don't know how to do it properly for the public Thickness BottomDrawerVerticalOffset
{
get
{
double screenHeightPx = DeviceDisplay.MainDisplayInfo.Height;
double screenHeightPt = screenHeightPx / DeviceDisplay.MainDisplayInfo.Density;
double offsetFromSample = 65;
double heightOfBottomBar = 50;
double result =
screenHeightPt
- heightOfBottomBar
- offsetFromSample;
var wrappedResult = new Thickness(
left : 0
, top : result
, right : 0
, bottom: 0
);
return wrappedResult;
}
} So
|
[UPD] seems like |
Can this be used in a grid or does it only work in a RelativeLayout?
The text was updated successfully, but these errors were encountered: