简体   繁体   English

Xamarin.Android Designer在手机上显示控件的方式有所不同

[英]Xamarin.Android Designer shows controls differently as they appear on my phone

I am unable to setup Xamarin.Android Designer pretty well. 我无法很好地设置Xamarin.Android Designer。 In my previous version of Windows and Visual Studio the Xamarin Default designer view looked Fine, but after upgrading to VS2015 and Win10 , My Designer doesn't seem to be very well, As it's controls show differently on the designer and differently on my mobile phone. 在我的Windows和Visual Studio的先前版本中,Xamarin Default设计器视图看起来不错 ,但是在升级到VS2015Win10之后 ,“我的设计器”看起来不太好,因为控件在设计器和手机上的显示方式有所不同。 I am sharing two pictures of how it looks like on my phone and how it looks on Xamarin Designer. 我要分享两张关于手机上的外观以及Xamarin Designer上的外观的图片。

In my Xamarin Designer: 在我的Xamarin Designer中: Xamarin设计器

In my Mobile Phone: 在我的手机中: 手机视图

Please assist me regarding this issue, Thank you! 请就此问题为我提供帮助,谢谢!

EDIT : 编辑
you won't be able to see the controls until you change their color if I choose the default theme of the designer. 如果我选择设计器的默认主题,则只有在更改控件的颜色后才能看到控件。
Here it is how it looks when the default theme is selected 这是选择默认主题时的外观 默认主题

EDIT : 编辑
=> Here is my Main.axml file code. =>这是我的Main.axml文件代码。

<?xml version="1.0" encoding="utf-8"?>
  <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:orientation="vertical"
      android:layout_width="fill_parent"
      android:weightSum="100"
      android:minWidth="25px"
      android:minHeight="25px"
      android:layout_height="fill_parent">
<TextView
    android:text="Create An Account"
    android:id="@+id/tvCreateAccount"
    android:textAppearance="?android:attr/textAppearanceMedium"
    android:layout_weight="20"
    android:textColor="#368DEB"
    android:gravity="center"
    android:textStyle="bold"
    android:textSize="25sp"
    android:layout_width="match_parent"
    android:layout_height="0dp" />
<Button
    android:id="@+id/btnSignin"
    android:text="Sign in"
    android:layout_width="match_parent"
    android:layout_height="0dp"
    android:layout_weight="15"
    android:background="@drawable/btnSignInStyle"
    android:layout_marginLeft="20dp"
    android:layout_marginRight="20dp"
    android:textSize="15sp" />
<TextView
    android:text="Or"
    android:id="@+id/tvOr"
    android:gravity="center"
    android:layout_width="match_parent"
    android:layout_height="0dp"
    android:layout_weight="15"
    android:textColor="#000000" />
<Button
    android:id="@+id/btnSignup"
    android:text="Sign Up with Email"
    android:layout_width="match_parent"
    android:layout_height="0dp"
    android:layout_weight="15"
    android:layout_marginLeft="20dp"
    android:layout_marginRight="20dp"
    android:textSize="15sp" />
<RelativeLayout
    android:id="@+id/relativeLayout"
    android:layout_width="match_parent"
    android:layout_height="0dp"
    android:layout_weight="35"
    android:minWidth="25px"
    android:minHeight="25px">
         <ProgressBar
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_centerInParent="true"
             android:indeterminate="true"
             android:id="@+id/progressBar1" />
     </RelativeLayout>
 </LinearLayout>

=> Here is the xml File that I am assigning to btnSignin =>这是我分配给btnSignin的xml文件

<selector xmlns:android="http://schemas.android.com/apk/res/android">
  <item android:state_pressed="false">
     <layer-list>
       <item android:right="2dp" android:top="5dp">
         <shape>
           <corners android:radius="2dp"/>
           <solid android:color="#D6D6D6"/>
         </shape>
       </item>

       <item android:bottom="2dp" android:left="2dp">
         <shape>
           <gradient android:angle="270" android:endColor="#4A6EA9" android:startColor="#4A6EA9"/>
           <stroke android:width="1dp" android:color="#BABABA"/>
           <corners android:radius="4dp"/> 
           <padding android:left="10dp" android:right="10dp" android:top="10dp" android:bottom="10dp"/>
         </shape>
       </item>
     </layer-list>
   </item>
   <item android:state_pressed="true">
     <layer-list>
       <item android:right="2dp" android:top="5dp">
         <shape>
           <corners android:radius="2dp"/>
           <solid android:color="#D6D6D6"/>
         </shape>
       </item>
       <item android:bottom="2dp" android:left="2dp">
         <shape>
           <corners android:radius="4dp"/>
           <gradient android:angle="270" android:endColor="#7C97C1" android:startColor="#4A6EA9"/>
           <stroke android:width="1dp" android:color="#BABABA"/>
           <padding android:left="10dp" android:right="10dp" android:top="10dp" android:bottom="10dp"/>
         </shape>
       </item>
     </layer-list>
   </item>
 </selector>

After doing all sort of work arounds I finally Solved my Problem. 经过各种工作后,我终于解决了我的问题。 What I did was downloaded the latest community version of Visual Studio 2015, and the Default Xamarin packages that were pre-installed in Visual Studio were not good for the health of my system. 我所做的是下载了最新的社区版本的Visual Studio 2015,并且预安装在Visual Studio中的Default Xamarin软件包对我的系统健康不利。 I just visited the Xamarin Site and downloaded the Xamarin components from there. 我刚刚访问了Xamarin网站,并从那里下载了Xamarin组件。 and It installed other features plus the new Xamarin for VS2015, And now working it's fine on Xamarin Studio and on Visual Studio also! 并且安装了其他功能以及VS2015的新Xamarin,现在可以在Xamarin Studio和Visual Studio上正常工作了!

更新后

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM