【发布时间】:2017-07-23 10:27:40
【问题描述】:
我为我的 android 项目制作了这个 xml 文件,该设计在我的手机上看起来很完美,但在我的平板电脑上运行它会使按钮、图像……看起来很小,我很想根据正在运行的设备。
这是我的 xml 文件:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/background"
android:fitsSystemWindows="true"
tools:context="molfix.dev.molfix.Activities.Bvn.BienvenuActivity">
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:background="#91d0f0"
android:layout_height="wrap_content">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="45dp"
android:background="@drawable/toolbar_bvn"
android:scrollbars="none"
app:popupTheme="@style/AppTheme.PopupOverlay"
android:weightSum="1">
</android.support.v7.widget.Toolbar>
</android.support.design.widget.AppBarLayout>
<Button
android:layout_width="250dp"
android:layout_height="55dp"
android:layout_marginLeft="30dp"
android:layout_marginRight="30dp"
android:background="@drawable/button_inscrip"
android:id="@+id/b_inscrip"
android:layout_marginTop="20dp"
android:layout_below="@+id/b_connex"
android:layout_centerHorizontal="true" />
<Button
android:layout_width="250dp"
android:layout_height="55dp"
android:background="@drawable/button_connex"
android:id="@+id/b_connex"
android:layout_marginTop="151dp"
android:layout_below="@+id/appbar"
android:layout_alignStart="@+id/b_inscrip" />
</RelativeLayout>
【问题讨论】:
标签: android-layout android-studio