Тема Android FullScreen уменьшает высоту отображаемой кнопки
У меня есть логин с двумя кнопками, одна моя, другая из Facebook SDK. Я вижу кнопку с идентификатором "auth", равным кнопке facebook по ширине и высоте. Если в манифесте я поставил
Android: тема ="@ андроид: стиль /Theme.NoTitleBar.Fullscreen"
чтобы получить активность в полноэкранном режиме, я получаю странный результат: высота моей кнопки уменьшается, поэтому я вижу растертый прямоугольник.
Это код 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>
1 ответ
Решение
Вы можете сделать деятельность в полноэкранном режиме с помощью кода Java вместо XML:
requestWindowFeature(Window.FEATURE_NO_TITLE);
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FUL LSCREEN);
setContentView(R.layout.activity_main);