2015-11-21 3 views
0

Я разработал Windows Phone app.but, что случилось, экран был идеальным в устройствах с разрешением 4 дюйма. Но 5-дюймовые или 6-дюймовые устройства с разрешением не были идеальными. Как решить эту проблему.Как установить кнопку в углу экрана в Windows Phone 8.1?

, пожалуйста, смотрите выше скриншоты. enter image description here

на приведенном выше экране короткое Я хочу установить кнопку - это угол экрана. В устройствах с разрешением 4 дюйма идеально подходят. Но кнопка 5 дюймов или 6 дюймов устройств не была установлена ​​в угол экрана. как установить кнопку в углу экрана.

ниже мой код

 <Grid Style="{StaticResource LayoutGridStyle}"> 

     <Pivot Title="RELOAD" CommonNavigationTransitionInfo.IsStaggerElement="True" Style="{StaticResource CustomPivotStyle}" BorderBrush="{StaticResource PhoneAccentBrush}" > 

      <Pivot.TitleTemplate> 
       <DataTemplate> 
        <Grid Background="White"> 
         <StackPanel Margin="0,0,0,10"> 
          <Image Source="/Images/logo.png" Height="40" Margin="0,0,-362,0"/> 
         </StackPanel> 

        </Grid> 
       </DataTemplate> 
      </Pivot.TitleTemplate> 
      <Pivot.HeaderTemplate> 
       <DataTemplate> 
        <TextBlock Text="{Binding}" FontSize="25" /> 
       </DataTemplate> 
      </Pivot.HeaderTemplate> 
      <PivotItem Header="MOBILE" Margin="0,10,0,0.167"> 

       <StackPanel> 

        <Grid> 
         <Button x:Name="prepaidbtn" Content="PREPAID" HorizontalAlignment="Left" Foreground="White" Background="#1e365a" Margin="0,5,0,1" RenderTransformOrigin="1.079,0.516" Click="prepaidbtn_Click" Width="118"></Button> 
         <Button x:Name="postpaidbtn" Content="POSTPAID" HorizontalAlignment="Right" Foreground="#A9A9A9" Background="#1e365a" Margin="281,5,0,0" Click="postpaidbtn_Click" Height="57"/> 
        </Grid> 
        <Grid x:Name="gridprepaid" Height="437" > 
         <Grid> 

          <TextBox x:Name="rechargePhoneno" MaxLength="10" PlaceholderText="Mobile Number" BorderBrush="#FFABAABF" Margin="10,10,10,0" Height="44" BorderThickness="0,0,0,2" VerticalAlignment="Top" TextChanged="rechargePhoneno_TextChanged" InputScope="Number"> 
          </TextBox> 
          <Button x:Name="Contactbtn" HorizontalAlignment="Right" Click="Contactbtn_Click" BorderThickness="0,0,0,0" Margin="315,-9,-9,366" Height="77"> 
           <StackPanel> 
            <Image Source="Images/n_contacts.9.png" Width="55" Height="38"/> 
           </StackPanel> 
          </Button> 

         </Grid> 


          <ComboBox x:Name="rechargeOperator1" BorderBrush="#FFABAABF" Margin="10,80,10,0" Height="44" BorderThickness="0,0,0,2" VerticalAlignment="Top" PlaceholderText="Select Operator" RenderTransformOrigin="0.5,0.5" SelectionChanged="rechargeOperator1_SelectionChanged" > 

          </ComboBox> 


          <ComboBox x:Name="rechargeCircles1" BorderBrush="#FFABAABF" Margin="10,160,10,0" Height="44" BorderThickness="0,0,0,2" VerticalAlignment="Top" PlaceholderText="Select Circle" RenderTransformOrigin="0.5,0.5" SelectionChanged="rechargeCircles1_SelectionChanged"> 

          </ComboBox> 

         <Grid x:Name="gridspecial" Visibility="Collapsed" > 
          <RadioButton x:Name="Topup" Content="Topup" FontSize="20" HorizontalAlignment="Left" Width="30" Margin="10,200,0,0" Foreground="#1e365a" Background="#1e365a" ></RadioButton> 
          <RadioButton x:Name="special" Content="Special" FontSize="20" HorizontalAlignment="Right" Margin="0,200,10,0" Foreground="#1e365a" Background="#1e365a" ></RadioButton> 
         </Grid> 
         <Grid > 
          <TextBox x:Name="txtamount" MaxLength="4" PlaceholderText="Amount" InputScope="Number" RenderTransformOrigin="0.5,0.5" BorderBrush="#FFABAABF" Margin="10,251,10,0" Height="44" BorderThickness="0,0,0,2" VerticalAlignment="Top"/> 
          <Button x:Name="plansbtn" Content="Browse Plans" RenderTransformOrigin="0.522,-0.018" Height="37" Foreground="#1e365a" Width="181" Click="plansbtn_Click" Margin="231,253,-12,123" FontSize="20" Background="{x:Null}" BorderBrush="{x:Null}" HorizontalAlignment="Right"/> 
         </Grid> 

          <Button x:Name="Recharge" Content="RECHARGE" Background="Red" Foreground="White" HorizontalAlignment="Stretch" Margin="10,0,0,42" RenderTransformOrigin="0.514,1.408" VerticalAlignment="Bottom" Height="70" Click="Recharge_Click" FontWeight="Bold" FontSize="25"> 

          </Button> 



         <Button VerticalAlignment="Bottom" HorizontalAlignment="Right" Height="97" BorderThickness="0" Margin="331,0,-40,-62" > 
          <StackPanel> 
           <Image Source="Images/ic_navigation_drawer.png" Stretch="Fill" Width="59" Height="39" /> 
          </StackPanel> 
          <Button.Flyout> 
           <MenuFlyout> 
            <MenuFlyoutItem x:Name="reloadcash" Text="Reloadcash" Click="reloadcash_Click" /> 
            <MenuFlyoutItem x:Name="prevoiusorders" Text="Previous orders" Click="prevoiusorders_Click"/> 
            <MenuFlyoutItem x:Name="profile" Text="profile" Click="profile_Click"/> 
            <MenuFlyoutItem x:Name="changepassword" Text="changepassword" Click="changepassword_Click"/> 
            <MenuFlyoutItem x:Name="Contacts" Text="Contacts" Click="Contacts_Click"/> 
            <MenuFlyoutItem x:Name="busorderhistory" Text="Busorderhistory" Click="busorderhistory_Click"></MenuFlyoutItem> 

           </MenuFlyout> 
          </Button.Flyout> 
         </Button> 
        </Grid> 

        <Grid x:Name="gridpoastpaid" Visibility="Collapsed"> 
         <Grid> 

          <TextBox x:Name="rechargePhonenopostpaid" MaxLength="10" PlaceholderText="Postpaid Mobile Number" BorderBrush="#FFABAABF" Margin="10,10,10,0" Height="44" BorderThickness="0,0,0,2" VerticalAlignment="Top" InputScope="Number" RenderTransformOrigin="0.5,0.5" TextChanged="rechargePhonenopostpaid_TextChanged" /> 
          <Button x:Name="Contactbtn1" Click="Contactbtn_Click" BorderThickness="0" Margin="315,-9,-9,366" Width="102" Height="77" HorizontalAlignment="Right"> 
           <StackPanel> 
            <Image Source="Images/n_contacts.9.png" Width="55" Height="38"/> 
           </StackPanel> 
          </Button> 
         </Grid> 
         <Grid> 

          <ComboBox x:Name="rechargeOperator1postpaid" PlaceholderText="Operator" SelectionChanged="rechargeOperator1postpaid_SelectionChanged" BorderBrush="#FFABAABF" Margin="10,80,10,0" Height="44" BorderThickness="0,0,0,2" VerticalAlignment="Top" /> 

         </Grid> 


         <Grid> 
          <TextBox x:Name="txtamountpostpaid" MaxLength="4" PlaceholderText="Amount" InputScope="Number" BorderBrush="#FFABAABF" Margin="10,160,10,0" Height="44" BorderThickness="0,0,0,2" VerticalAlignment="Top" /> 

         </Grid> 
         <Grid > 
          <Button x:Name="pay" Content="PAY" Background="Red" Foreground="White" HorizontalAlignment="Stretch" Margin="0,240,0,123" FontSize="25" FontWeight="Bold" Height="70" Click="pay_Click"/> 
         </Grid> 
         <Button VerticalAlignment="Bottom" HorizontalAlignment="Right" Height="106" BorderThickness="0" Width="74" Margin="0,392,-32,-65" > 
          <StackPanel> 
           <Image Source="Images/ic_navigation_drawer.png" Stretch="Fill" Width="70" Height="37" /> 
          </StackPanel> 
          <Button.Flyout> 
           <MenuFlyout> 
            <MenuFlyoutItem x:Name="reloadcash6" Text="Reloadcash" Click="reloadcash_Click" /> 
            <MenuFlyoutItem x:Name="prevoiusorders6" Text="Previous orders" Click="prevoiusorders_Click"/> 
            <MenuFlyoutItem x:Name="profile6" Text="profile" Click="profile_Click"/> 
            <MenuFlyoutItem x:Name="changepassword6" Text="changepassword" Click="changepassword_Click"/> 
            <MenuFlyoutItem x:Name="Contacts6" Text="Contacts" Click="Contacts_Click"/> 
            <MenuFlyoutItem x:Name="busorderhistory6" Text="Busorderhistory" Click="busorderhistory_Click"></MenuFlyoutItem> 


           </MenuFlyout> 
          </Button.Flyout> 
         </Button> 
        </Grid> 

       </StackPanel> 

      </PivotItem> 
</Pivot> 
    </Grid> 

требуется кнопка ниже кнопки перезаряда.

+0

Здравствуйте, кнопки, которые вы хотите установить в углу, пожалуйста, вы можете предоставить некоторый код. –

+0

@kushalmaniyar см. Мой отредактированный код –

+0

Я не могу понять, какую кнопку вы хотите установить. Из выше кода удалите поле и попробуйте. –

ответ

1

попробовать этот код

<Button VerticalAlignment="Bottom" HorizontalAlignment="Right" BorderThickness="0" > 
         <!--<StackPanel> 
          <Image Source="Assets/SmallLogo.png" Stretch="Fill" Width="59" Height="39" /> 
         </StackPanel>--> 
         <Button.Background> 
          <ImageBrush ImageSource="Assets/SmallLogo.png"/> 
         </Button.Background> 
         <Button.Flyout> 
          <MenuFlyout> 
           <MenuFlyoutItem x:Name="reloadcash" Text="Reloadcash" Click="reloadcash_Click" /> 
           <MenuFlyoutItem x:Name="prevoiusorders" Text="Previous orders" Click="prevoiusorders_Click"/> 
           <MenuFlyoutItem x:Name="profile" Text="profile" Click="profile_Click"/> 
           <MenuFlyoutItem x:Name="changepassword" Text="changepassword" Click="changepassword_Click"/> 
           <MenuFlyoutItem x:Name="Contacts" Text="Contacts" Click="Contacts_Click"/> 
           <MenuFlyoutItem x:Name="busorderhistory" Text="Busorderhistory" Click="busorderhistory_Click"></MenuFlyoutItem> 

          </MenuFlyout> 
         </Button.Flyout> 
        </Button> 
+0

Я использую код выше, но не работает. –

+0

Мне дано margin = 0, но не использовать –

+0

Затем, я должен проверить весь код xaml –

Смежные вопросы