view - My picture don't appear on screen on my device -


hello,

have problem device. created layout. works fine emulator. when export project gs3 image view disapear.

can ? try delete buttons see if picture appear doesn't work.

picture in png format.

thank you

    //obtenir les dimensions de l'écran     display display = getwindowmanager().getdefaultdisplay();      int largeur = display.getwidth();     int hauteur= display.getheight();     int orientation = display.getorientation();      if (orientation==1 || orientation==3)     {         linearlayout accueil = new linearlayout(this);// création de la page d'accueil sans passer par les xml         accueil.setlayoutparams(new layoutparams(layoutparams.match_parent, layoutparams.match_parent));         accueil.setbackgroundcolor(0xff6e2524);         accueil.setorientation(linearlayout.vertical);          textview title = new textview(this);//creation du titre         layoutparams lparams1 = new layoutparams(layoutparams.match_parent, layoutparams.wrap_content);         title.setlayoutparams(lparams1);//fixer largeur hauteur         title.setgravity(gravity.center);         title.settextcolor(0xffffffff);         title.settext("toucher pour créer");         title.settextsize(typedvalue.complex_unit_px, hauteur*8/100);//réglage pour adapter le texte à la taille de l'écran         accueil.addview(title); // ajout au layout principal           button b1 = new button(this);         linearlayout.layoutparams lparams2 = new linearlayout.layoutparams(linearlayout.layoutparams.wrap_content, linearlayout.layoutparams.wrap_content);         lparams2.setmargins(largeur/8, hauteur/18, largeur/8, 0); //fixe les marges         b1.setlayoutparams(lparams2);//fixer largeur hauteur         b1.setminimumwidth(largeur*8/10);//fixe la largeur minimal          b1.setbackgroundcolor(0xffb7c025);         b1.setgravity(gravity.center);         b1.settextcolor(0xffffffff);         b1.settext("galerie des oeuvres");         b1.settextsize(typedvalue.complex_unit_px, hauteur*5/100);//réglage pour adapter le texte à la taille de l'écran         accueil.addview(b1); // ajout au layout principal           button b2 = new button(this);         linearlayout.layoutparams lparams3 = new linearlayout.layoutparams(linearlayout.layoutparams.wrap_content, linearlayout.layoutparams.wrap_content);         lparams3.setmargins(largeur/8, hauteur/18, largeur/8, 0); //fixe les marges         b2.setlayoutparams(lparams3);//fixer largeur hauteur         b2.setminimumwidth(largeur*8/10);//fixe la largeur minimal          b2.setbackgroundcolor(0xffb7c025);         b2.setgravity(gravity.center);         b2.settextcolor(0xffffffff);         b2.settext("prise en main");         b2.settextsize(typedvalue.complex_unit_px, hauteur*5/100);//réglage pour adapter le texte à la taille de l'écran         accueil.addview(b2); // ajout au layout principal           button b3 = new button(this);         linearlayout.layoutparams lparams4 = new linearlayout.layoutparams(linearlayout.layoutparams.wrap_content, linearlayout.layoutparams.wrap_content);         lparams4.setmargins(largeur/8, hauteur/18, largeur/8, 0); //fixe les marges         b3.setlayoutparams(lparams4);//fixer largeur hauteur         b3.setminimumwidth(largeur*8/10);//fixe la largeur minimal          b3.setbackgroundcolor(0xffb7c025);         b3.setgravity(gravity.center);         b3.settextcolor(0xffffffff);         b3.settext("quitter");         b3.settextsize(typedvalue.complex_unit_px, hauteur*5/100);//réglage pour adapter le texte à la taille de l'écran         accueil.addview(b3); // ajout au layout principal           imageview logo = new imageview(this);         linearlayout.layoutparams lparams5 = new linearlayout.layoutparams(linearlayout.layoutparams.wrap_content, hauteur/15);//calculer pour garder le ratio 1/2         lparams5.setmargins(largeur/18, hauteur/18, 0, 0); //fixe les marges         logo.setlayoutparams(lparams5);         logo.setadjustviewbounds(true);         logo.setimageresource(r.drawable.logo);         accueil.addview(logo);//ajout au layout ppl           setcontentview(accueil);//mise en place du layout accueil     }     else     {     linearlayout accueil = new linearlayout(this);// création de la page d'accueil sans passer par les xml     accueil.setlayoutparams(new layoutparams(layoutparams.match_parent, layoutparams.match_parent));     accueil.setbackgroundcolor(0xff6e2524);     accueil.setorientation(linearlayout.vertical);      textview title = new textview(this);//creation du titre     layoutparams lparams1 = new layoutparams(layoutparams.match_parent, layoutparams.wrap_content);     title.setlayoutparams(lparams1);//fixer largeur hauteur     title.setgravity(gravity.center);     title.settextcolor(0xffffffff);     title.settext("toucher pour créer");     title.settextsize(typedvalue.complex_unit_px, largeur*8/100);//réglage pour adapter le texte à la taille de l'écran     accueil.addview(title); // ajout au layout principal       button b1 = new button(this);     linearlayout.layoutparams lparams2 = new linearlayout.layoutparams(linearlayout.layoutparams.wrap_content, linearlayout.layoutparams.wrap_content);     lparams2.setmargins(largeur/8, hauteur/8, largeur/8, 0); //fixe les marges     b1.setlayoutparams(lparams2);//fixer largeur hauteur     b1.setminimumwidth(largeur*8/10);//fixe la largeur minimal      b1.setbackgroundcolor(0xffb7c025);     b1.setgravity(gravity.center);     b1.settextcolor(0xffffffff);     b1.settext("galerie des oeuvres");     b1.settextsize(typedvalue.complex_unit_px, largeur*6/100);//réglage pour adapter le texte à la taille de l'écran     accueil.addview(b1); // ajout au layout principal       button b2 = new button(this);     linearlayout.layoutparams lparams3 = new linearlayout.layoutparams(linearlayout.layoutparams.wrap_content, linearlayout.layoutparams.wrap_content);     lparams3.setmargins(largeur/8, hauteur/8, largeur/8, 0); //fixe les marges     b2.setlayoutparams(lparams3);//fixer largeur hauteur     b2.setminimumwidth(largeur*8/10);//fixe la largeur minimal      b2.setbackgroundcolor(0xffb7c025);     b2.setgravity(gravity.center);     b2.settextcolor(0xffffffff);     b2.settext("prise en main");     b2.settextsize(typedvalue.complex_unit_px, largeur*6/100);//réglage pour adapter le texte à la taille de l'écran     accueil.addview(b2); // ajout au layout principal       button b3 = new button(this);     linearlayout.layoutparams lparams4 = new linearlayout.layoutparams(linearlayout.layoutparams.wrap_content, linearlayout.layoutparams.wrap_content);     lparams4.setmargins(largeur/8, hauteur/8, largeur/8, 0); //fixe les marges     b3.setlayoutparams(lparams4);//fixer largeur hauteur     b3.setminimumwidth(largeur*8/10);//fixe la largeur minimal      b3.setbackgroundcolor(0xffb7c025);     b3.setgravity(gravity.center);     b3.settextcolor(0xffffffff);     b3.settext("quitter");     b3.settextsize(typedvalue.complex_unit_px, largeur*6/100);//réglage pour adapter le texte à la taille de l'écran     accueil.addview(b3); // ajout au layout principal       imageview logo = new imageview(this);     linearlayout.layoutparams lparams5 = new linearlayout.layoutparams(linearlayout.layoutparams.wrap_content, hauteur/20);//calculer pour garder le ratio 1/2     lparams5.setmargins(largeur/18, hauteur/18, 0, 0); //fixe les marges     logo.setlayoutparams(lparams5);     logo.setadjustviewbounds(true);     logo.setimageresource(r.drawable.logo);     accueil.addview(logo);//ajout au layout ppl       setcontentview(accueil);//mise en place du layout accueil     } 


Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -