1
私のアプリケーションのリスティングページでFloatingActionButtonを使用していますが、searchBarも追加します。しかし、私はそれらのページを表示することができませんでした。私のコードとスクリーンショットがダウンしています。 searchBarを表示するにはどうすればよいですか?Xamarin Forms RelativeLayout
FAB Github
マイコード:
<ContentPage.Content>
<RelativeLayout>
<SearchBar
x:Name="searchBar"
Placeholder="Ara"
/>
<ContentView
RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=1}"
RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=1}">
<ListView
x:Name="list"
BackgroundColor="White">
<ListView.ItemTemplate>
<DataTemplate>
<TextCell
Text="{Binding .}" />
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</ContentView>
<fab:FloatingActionButton
x:Name="fabBtn"
Source="plus.png"
Size="Normal"
Clicked="Handle_FabClicked"
NormalColor="Green"
RippleColor="Red"
RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=1, Constant=-75}"
RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=1, Constant=-75}" />
</RelativeLayout>
</ContentPage.Content>
</ContentPage>
iOSのフローティングアクションボタン?デザインがiOSに適していると確信していますか? – Cheesebaron
はい、問題なく動作します。 – ozmert75
とにかく、あなたのコードを見ると、ContentViewはSearchBarをオーバーラップさせています。そのため、あなたはそれを見ることができません。 – Cheesebaron