Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

I cannot set multiple relatives in I cannot set multiple relatives in xamarin

$
0
0

I need to set of my images top off one and another in order to do this I used relative layout what I need is like this menu bar to create in xamarin forms

so I used code like this in another page and I include it to where ever I want

  <RelativeLayout>
<customRenderes:NavigationImageButton Source="MenuSettings"                                                
                                                  x:Name="Button1"                                                                                                                                                                                                                                    
                                                   Margin="10"
                                                  Opacity="0.4"                                                                                                          
                                 ItemTapped="Button1_OnItemTapped"

            />
<customRenderes:NavigationImageButton Source="MenuPatientSearch"  RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToView,ElementName=Button1,Property=Height,Factor=1,Constant=10}" 

                                  x:Name="Button2"                                                                                                                                                        
                                  Margin="10"
                                  Opacity="0.4"
                                  ItemTapped="Button1_OnItemTapped"                                                                                                                                                                                                              

/>
<customRenderes:NavigationImageButton Source="MenuNotifications" RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToView,ElementName=Button2,Property=Height,Factor=1,Constant=10}"

                                      x:Name="Button3"                                                                                                                                                           
                                      Margin="10"
                                      Opacity="0.4"
                                      ItemTapped="Button1_OnItemTapped"                                                                                                                                                                      

/>
<customRenderes:NavigationImageButton Source="MenuShedules"  RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToView,ElementName=Button3,Property=Height,Factor=1,Constant=10}" 

                                      x:Name="Button4"                                                                                                                                                           
                                      Margin="10"
                                      Opacity="0.4"
                                      ItemTapped="Button1_OnItemTapped"                                                                                                                                                                                                              
/>
<customRenderes:NavigationImageButton Source="menu"  RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToView,ElementName=Button4,Property=Height,Factor=1,Constant=10}" 

                                      x:Name="Button5"                                                                                                                                                              
                                      Margin="10"
                                      Opacity="0.4"
                                      ItemTapped="Button1_OnItemTapped"                                                                                                                                                                                                              
/>


But it only shows to of them one is Menu setting and all other are overlapping in on place How to solve this and I need a view like in that image how to achieve this with or without relative layout.

(I used this code in the custom control and then I exclude it from where ever I need I don't need to compromise that too)


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>