1
J'utilise une image pour le champ de texte.comment utiliser l'image pour le champ de texte - j2me blackberry
Lorsque je me concentre dessus pour écrire quelque chose, la première lettre du texte que j'écris est à moitié coupée.
Comment éviter cela?
Mon code est:
textbox = new EditField(EditField.NO_NEWLINE)
{
protected void layout(int width, int height)
{
super.layout(1000, 38);
super.setExtent((Display.getWidth()),30);
}
}
manager = new VerticalFieldManager(HORIZONTAL_SCROLL)
{
protected void paint(Graphics g)
{
int x = this.getHorizontalScroll();
g.drawBitmap(x, 0,textbox.getWidth(),textboxc.getHeight(),textbox, 0, 0);
super.paint(g);
}
protected void sublayout(int maxWidth, int maxHeight)
{
Field field = testbox;
layoutChild(field, Display.getWidth(), Display.getHeight());
setPositionChild(field, 148, 8);
super.sublayout(maxWidth, maxHeight);
}
}
manager.add(textbox);
comment formater ce code – Swati
sélectionner votre code et appuyez sur Ctrl + k pour le code formattage. – Vivart
merci beaucoup fr code de mise en forme vivart – Swati