Android的Studio设计显示部件和放大器;片段不同于我的手机 [英] Android Studio Designer displaying widgets & fragments differently than my phone

查看:216
本文介绍了Android的Studio设计显示部件和放大器;片段不同于我的手机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有问题项目的显示方式在Android Studio设计和我的电话。第一个问题是,窗口小部件和安培;片段出现在不同设计师/仿真器比我的手机。我曾尝试降低设计师的分辨率测试其他设备分辨率,但它仍然会出现不同的我的手机上尽管相对同样的决议。

I'm having problems with how items appear in the Android Studio Designer and my phone. The first problem is that widgets & fragments appear differently in the designer/emulator than on my phone. I have tried lowering the resolution in the designer to test other device resolutions but it still appears differently on my phone despite the resolutions being relatively the same.

设计师观点:

http://i.imgur.com/5kZKFDd.png

HTC Desire的510:

HTC Desire 510:

http://i.imgur.com/SqDiyBy.png

设计者认为是使用的Nexus S的分辨率比我的手机分辨率较小,但该项目仍然会出现不同。我其实使用RelativeLayout的。

The designer view is using the Nexus S's resolution which is smaller than my phone's resolution, yet the items still appear differently. I am in fact using RelativeLayout.

另一个问题是,如果你注意到,按钮和文本不同出现在设计/仿真器比我的手机。当我点击我的电话的按键,有下跌的影响没有按钮,但在模拟器,效果present。这是有问题的,因为我希望我的设计是在所有设备上保持一致。

The other problem is that if you noticed, the button and text appears differently in the designer/emulator than on my phone. When I click the button on my phone, there is no button down effect, yet in the emulator, the effect is present. This is problematic because I want my designs to be consistent across all devices.

推荐答案

设计师/仿真器采用Android的正式框架,而一些移动设备制造商可能会修改一些外观框架部件,所以视图你看设计师可能会从你的实际设备看到不同的,甚至是不同的设备有不同的外观对于一些小部件。

The designer/emulator use the official frameworks of android, while Some mobile device manufacturer may modify some appearance of widgets in frameworks, so the "View" you see in designer may be different from what you see in real devices, even different devices have different appearance for some widgets.

支持真正的设备没有修改部件外观框架,那么你可以期望他们有相同的外观设计/仿真器。有一点要注意,机器人工作室的设计师呈现视图使用某些主题,您可以指定使用的主题是工具:背景属性或选择一个在选项,例如:

Support the real device have not modified widgets appearance in frameworks, then you can expect them have the same appearance with designer/emulator. One thing to notice, Android studio designer renders "Views" using some theme, you can specify the theme using "tools:context" attribute or select one in options, for example:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
          xmlns:tools="http://schemas.android.com/tools"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:orientation="horizontal"
          tools:context=".MainActivity"/>

这篇关于Android的Studio设计显示部件和放大器;片段不同于我的手机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆