0

내 애플리케이션에는 이 있습니다.이 화면에는 VerticalHorizontal 필드 관리자가 많이 포함되어 있으며 스크롤 할 때 모든 컨텐츠가 성공적으로 표시됩니다.블랙 베리의 메인 필드 매니저에서 배경 이미지 스크롤을 사용 중지합니다.

이것은 내 메인 VerticalFieldmanager 코드입니다.

vfm_Main = new VerticalFieldManager() 
    { 
      public void paint(Graphics g) 
      { 
       g.setColor(Color.WHITE); 
       g.drawBitmap(0,0,mybackgroundImage.getWidth(),mybackgroundImage.getHeight(),mybackgroundImage,0,0); 
            super.paint(g); 
      } 
      protected void sublayout(int maxWidth, int maxHeight) 
      { 
       super.sublayout(Display.getWidth(),Display.getHeight()); 
       setExtent(Display.getWidth(),Display.getHeight()); 
      } 
    }; 

화면이 하나의 배경에 묘화가있다. 이 화면의 전체 내용을 보려면이 화면을 스크롤 할 때 내 배경 이미지도 내용과 함께 스크롤됩니다. 그 이유는 배경 이미지가 너무 흐릿 해 보이며 화면 맨 아래에 반복됩니다.

나는이 화면의 내용 만 스크롤하려고합니다.이 방법을 구현하는 방법은 무엇입니까?

나는 많은 시도를했지만 suggetion을 얻지 못했고 그것을 방지하기 위해 안타? 이 문제에 직면 한 사람이 있거나 도움이된다면 ...

감사합니다.

답변

1

이 같이해야 할이 이미지처럼

vfm_Main = new VerticalFieldManager() 
{ 
      public void paint(Graphics g) 
      { 
       g.setColor(Color.WHITE); 
       g.drawBitmap(0,0,mybackgroundImage.getWidth(),mybackgroundImage.getHeight(),mybackgroundImage,0,0); 
       super.paint(g); 
      } 
      protected void sublayout(int maxWidth, int maxHeight) 
      { 
        super.sublayout(Display.getWidth(),Display.getHeight()); 
        setExtent(Display.getWidth(),Display.getHeight()); 
      } 
}; 

subver=new VerticalFieldManager(VERTICAL_SCROLL|VERTICAL_SCROLLBAR) 
{ 
     protected void sublayout(int maxWidth, int maxHeight) 
     { 
       super.sublayout(Display.getWidth(),Display.getHeight()-3);//here we scroll the inner vertical 
       setExtent(Display.getWidth(),Display.getHeight()-3); 
     } 
} 
//Write all the code here; 
subver.setpadding(1,0,0,0); 
vfm_main.add(subver); 
add(vfm_Main); 

: 충분한

Vertical Scrolling

;

+0

than @alishaik .. 이미이 방법을 구현했습니다 ...하지만 여전히 backround 이미지도 스크롤합니다 ... 이것을 성공적으로 구현 했습니까? – Hitarth

+0

나는 이것을 좋아했다. 그리고 성공적으로 실행됩니다. 코더. – alishaik786

0

나는 한번도 같은 문제에 직면했다. 나는 2 명의 현장 관리자를 사용하여이 문제를 해결했다.

VerticalFieldManager mainManager = new VerticalFieldManager(Manager.NO_VERTICAL_SCROLL | Manager.NO_VERTICAL_SCROLLBAR) 
    { 

     public void paint(Graphics graphics) 
     { 
      graphics.clear(); 
      graphics.drawBitmap(0, 0, Display.getWidth(), Display.getHeight(), backgroundBitmap, 0, 0);      
      super.paint(graphics); 
     }    
    }; 
    //this manager is used for adding the componentes 
    VerticalFieldManager subManager = new VerticalFieldManager(Manager.VERTICAL_SCROLL | Manager.VERTICAL_SCROLLBAR) 
    { 
     protected void sublayout(int maxWidth, int maxHeight) 
     { 
      int displayWidth = Display.getWidth(); 
      int displayHeight = Display.getHeight(); 

      super.sublayout(displayWidth, displayHeight); 
      setExtent(displayWidth, displayHeight); 
     } 
    };