【发布时间】:2014-12-11 14:26:03
【问题描述】:
我有一个带有两个按钮的登录活动,一个是我的,另一个来自 Facebook SDK。 我可以看到 id 为“auth”的按钮在宽度和高度上等于 facebook 按钮。 如果在我设置的清单中
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
要全屏显示活动,我有一个奇怪的结果:我的 Button 的高度减小了,所以我看到了一个混搭的矩形。
这是login.xml的代码:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:facebook="http://schemas.android.com/apk/res-auto"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/login_bg"
android:fillViewport="true" >
<LinearLayout
android:id="@+id/container"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<LinearLayout
android:id="@+id/header"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:padding="10dip"
android:gravity="center" >
<!-- Logo Start -->
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/logo_claim" />
<!-- Logo Ends -->
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:padding="10dip"
android:orientation="vertical">
<Button
android:id="@+id/auth"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="@drawable/loginbutton"
android:textColor="#FFFFFF"
android:textStyle="bold"
android:textSize="16sp"
android:text="Login" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_margin="10dp"
android:padding="10dip" >
<com.facebook.widget.LoginButton
android:id="@+id/authButton"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
facebook:login_text="Login with Facebook" />
<com.facebook.widget.LoginButton
android:id="@+id/logoutButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Logout"
android:visibility="gone" />
</LinearLayout>
</LinearLayout>
</ScrollView>
【问题讨论】:
标签: android button styles height themes