Khái niệm chỉ số z? Hình ảnh cho thấy không có chồng chéo. Cách đặt chỉ mục z? hai hộp chọn tùy chỉnh hàng đầuLàm thế nào để chồng lên nhau trong các hình thức Xamarin?
<AbsoluteLayout Padding="10,10,10,10" VerticalOptions="FillAndExpand">
<ui:BoxSelector x:Name="selectorExchangs"
AbsoluteLayout.LayoutBounds="0,0,0.5,0.3"
AbsoluteLayout.LayoutFlags="All"
BackgroundColor="Transparent"
CommandAfterChanged="{Binding ExchangesAfterChangedCommand}"
Items="{Binding ExchangesList}"
LabelPath="Name"
PanelColor="#f9f9f9"
SelectedItem="{Binding SelectedExchange}"
SelectorLabel="EXCHANGE" />
<ui:BoxSelector AbsoluteLayout.LayoutBounds="1,0,0.5,0.3"
AbsoluteLayout.LayoutFlags="All"
BackgroundColor="Transparent"
CommandAfterChanged="{Binding TradingPairAfterChangedCommand}"
Items="{Binding AvailableTradinPairsList}"
LabelPath="PriceCurrencyName"
PanelColor="#f9f9f9"
SelectedItem="{Binding SelectedTraingPair}"
SelectorLabel="CURRENCY" />
Và mọi thứ còn lại. Biểu đồ, dữ liệu, e.t.c
<StackLayout AbsoluteLayout.LayoutBounds="1,1,1,0.9" AbsoluteLayout.LayoutFlags="All">...</StackLayout>
BoxSelector.xaml (nội dung xem), Reusable contentView mở rộng
<ContentView.Resources>
<ResourceDictionary x:Name="AppDictionary">
<Color x:Key="BackgroundColor">#f9f9f9</Color>
<Color x:Key="BorderColor">#e2e2e2</Color>
<Style x:Key="InternalViewStyle" TargetType="ContentView">
<Setter Property="BackgroundColor" Value="{StaticResource BackgroundColor}" />
<Setter Property="VerticalOptions" Value="Fill" />
<Setter Property="Padding" Value="5,5,5,5" />
</Style>
<Style x:Key="BorderStyle" TargetType="ContentView">
<Setter Property="BackgroundColor" Value="{StaticResource BorderColor}" />
<Setter Property="Padding" Value="1,1,1,1" />
</Style>
</ResourceDictionary>
</ContentView.Resources>
<StackLayout BindingContext="{x:Reference Name=ContentView}" HorizontalOptions="FillAndExpand">
<ContentView BackgroundColor="#f5f5f5" HorizontalOptions="FillAndExpand">
<StackLayout>
<ContentView Style="{StaticResource BorderStyle}">
<ContentView Style="{StaticResource InternalViewStyle}">
<StackLayout Orientation="Horizontal">
<StackLayout x:Name="selectorBox"
BackgroundColor="{Binding PanelColor}"
HorizontalOptions="FillAndExpand"
Orientation="Horizontal">
<StackLayout HorizontalOptions="StartAndExpand" Orientation="Horizontal">
<Label FontSize="12"
HorizontalOptions="FillAndExpand"
Text="{Binding SelectorLabel}"
TextColor="#cccccc" />
<Label x:Name="valueLabe"
BackgroundColor="{Binding PanelColor}"
FontSize="13"
HorizontalOptions="FillAndExpand"
Text="Choose"
TextColor="#313131" />
</StackLayout>
<StackLayout HorizontalOptions="EndAndExpand">
<Label Text="+" TextColor="#313131" />
</StackLayout>
</StackLayout>
</StackLayout>
</ContentView>
</ContentView>
<Grid x:Name="boxSelectorGrid"
BackgroundColor="#f5f5f5"
Padding="10,10,10,10">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
</Grid>
</StackLayout>
</ContentView>
</StackLayout>
Tôi e rằng mình không hiểu câu hỏi của bạn. Bạn nói rằng hình ảnh cho thấy không có chồng lên nhau, nhưng "trùng lặp" có nghĩa là một điều được vẽ trên một hình khác, mà hình ảnh hiển thị rõ ràng. Bạn đang cố gắng ẩn lớp cơ bản? –
Có, sau khi nhấp vào – bleggleb
Có vẻ như tôi chỉ là phần bạn thiếu là một nền mờ trên lớp trên cùng của bạn - các thành phần như '' không có bộ màu nền và do đó mặc định là trong suốt. Vì vậy, bất kỳ yếu tố nào là "lớp trên cùng" của bạn, chỉ cần một 'BacgkroundColor =" # f9f9f9 "' để đạt được hiệu quả mà bạn muốn. –
Joe