Android布局缩放问题

3

从标题中可以理解,我目前构建的项目在缩放方面存在一些问题。 在我的GalaxyS5上一切都运行得很完美,但是当我尝试在一个屏幕更大的三星平板电脑上运行它时,我遇到了一些问题。

由于我无法发布图片,请使用以下链接查看我的问题的视觉描述: https://www.sendspace.com/file/83j0tp

更新:由于我已经有10个声望帖子,我可以添加图片。

三星S5

状态1

enter image description here

状态2

enter image description here

三星平板电脑

状态1

enter image description here

状态 2

enter image description here

这是我的XML代码:
我希望你们能帮助我解决问题。
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">


<LinearLayout
    android:layout_alignParentBottom="true"
    android:orientation="horizontal"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:id="@+id/linearLayout5"
    android:layout_alignTop="@+id/linearLayout6">

    <ImageView
        android:id="@+id/loginImage"
        android:layout_width="fill_parent"
        android:layout_height="match_parent" />
    <ImageView
        android:id="@+id/loginImage2"
        android:layout_width="fill_parent"
        android:layout_height="match_parent" />

    <TextView
        android:layout_width="372dp"
        android:layout_height="match_parent"
        android:layout_alignLeft="@+id/loginImage"
        android:layout_alignTop="@+id/loginImage"
        android:layout_alignRight="@+id/loginImage"
        android:layout_alignBottom="@+id/loginImage"
        android:gravity="center|right"
        android:id="@+id/textLoginmail" />
</LinearLayout>

<LinearLayout
    android:layout_alignParentBottom="true"
    android:layout_width="fill_parent"
    android:layout_height="49.5dp"
    android:layout_marginTop="45dp"
    android:id="@+id/linearLayout6"
    android:weightSum="1"
    android:layout_alignParentEnd="false">

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="fill_parent"
        android:text="Registreer"
        android:gravity="center|right"
        android:textColor="#FFFFFF"
        android:id="@+id/textRegistreer"
        android:layout_weight="0.72" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="fill_parent"
        android:id="@+id/textLogin"
        android:layout_weight="0.44"
        android:text="Login"
        android:textColor="#FFFFFF"
        android:gravity="center"/>

    <Button
        android:layout_width="81dp"
        android:layout_height="wrap_content"
        android:background="@android:color/transparent"
        android:id="@+id/closeButton" />

</LinearLayout>

<FrameLayout
    android:layout_above="@id/linearLayout5"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginBottom="25dp"
    android:id="@+id/framelayout_facebook">

    <ImageView
        android:id="@+id/facebookImage"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

    <com.facebook.widget.LoginButton
        android:id="@+id/fb_login_button"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:drawableLeft="@drawable/ic_action_labels"
        android:drawableRight="@drawable/ic_action_next_item"
        android:layout_marginLeft="20dp"
        android:layout_marginRight="20dp"/>
    <LinearLayout
        android:clickable="true"
        android:focusable="true"
        android:focusableInTouchMode="true"
        android:orientation="horizontal"
        android:id="@+id/overlay_for_terms"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:weightSum="1">

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:gravity="center"
            android:textColor="#FFFFFF"
            android:id="@+id/textFacebook"
            android:layout_weight="0.90" />
    </LinearLayout>
</FrameLayout>


请注意,三星S5和Tab的屏幕尺寸不同。了解有关如何处理多屏幕尺寸的信息,请访问http://developer.android.com/training/multiscreen/screensizes.html。 - Utpal Sharma
s5从hdpi文件夹中获取文件...请检查您的选项卡文件夹,它可能会从xhdpixxhdpi中获取。 - prabhakaran
这些图片是从服务器上获取的。你检查了sendspace文件吗?我认为这不是hdpi或mdpi的问题,我认为我的代码不正确。 - Zakdroid
不知道是否有影响,但我注意到在linearLayout6中定义的weightSum比子视图的权重之和要小。尝试将weightSum省略或增大它。 - Ivo
你说的没错,uvo。其中一个按钮比另一个略大,但这并不能解决我的问题,因为文本仍然会固定在白色标记之间,但变得非常大...虽然图片上看不到,但即使在按钮外部它们也是可点击的。还是谢谢你的回应。 - Zakdroid
1个回答

0

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接