J'ai un ViewFlipper dans ma mise en page xml qui contient une image. Je voudrais afficher cette image en plein écran. Peu importe quel ScaleType j'utilise pour l'image je ne peux pas obtenir l'image pour afficher le plein écran.Image plein écran dans un ViewFlipper
C'est ma mise en page:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ViewFlipper android:layout_height="fill_parent" android:id="@+id/flipperView" android:layout_width="fill_parent">
<FrameLayout android:id="@+id/frameLayout1" android:layout_height="fill_parent" android:layout_width="fill_parent">
<ImageView android:src="@drawable/my_drawable" android:id="@+id/bcImageView" android:layout_width="fill_parent" android:layout_gravity="center" android:scaleType="fitCenter" android:layout_height="wrap_content"></ImageView>
</FrameLayout>
</ViewFlipper>
</LinearLayout>
Et ceci est le code dans mon activité:
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Force landscape mode
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
// Hide window title and go fullscreen
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.flippertest);
mViewFlipper = (ViewFlipper) findViewById(R.id.flipperView);
mViewFlipper.setFocusableInTouchMode(true);
mViewFlipper.requestFocus();
mViewFlipper.setOutAnimation(this, android.R.anim.slide_out_right);
mViewFlipper.setInAnimation(this, android.R.anim.slide_in_left);
J'ai aussi essayé d'utiliser:
mViewFlipper.setClipChildren(false);
mViewFlipper.setMinimumHeight(300);
avec différentes valeurs de hauteur minimale mais rien.
Des idées pour lesquelles l'image n'est pas affichée en plein écran?
Avez-vous déjà eu ça au travail? ayant un problème similaire – Bex
nope, j'ai entièrement repensé l'interface utilisateur. –
considère la même chose! – Bex