2011-03-06 2 views
4

일부 EditText가있는 활동으로 작업 중입니다. EditText 소프트 키 보드를 클릭/터치하면 나타납니다. 그러나 화면 아래에있는 EditTexts는 softkeyboard와 겹칩니다. EditText의 위쪽 절반이 보이고, 아래쪽 절반이 키보드 아래 있습니다. Android - EditText가 Softkeyboard와 겹칩니다.

나는

을 방지하는 방법에 대한 어떤 제안 AndroidManifest.xml에

에서 android:windowSoftInputMode="adjustPan"을 설정?

답변

4

나는 this 링크를 봐야한다고 생각합니다. 그 prob. 네가 가진 것과 아주 비슷해 보인다.

+0

그 링크는 나를 더 잘 도와줍니다. ' 대신 3을 설정하십시오 감사합니다. – Shaiful

+0

멋진 gud 행운을 앞두고. –

0

나를 위해 나는 키보드 높이가 특정 측정이라고 가정하고 싶지 않았습니다. 이 작업을 수행 한 후 onTouchListener을하고 대한 관심을 볼 무엇 이건 :

setOnTouchListener(new OnTouchListener() { 



     Runnable shifter=new Runnable(){ 
      public void run(){ 
       try { 
        int[] loc = new int[2];     
        //get the location of someview which gets stored in loc array 
        findViewById(R.id.someview).getLocationInWindow(loc); 
        //shift so user can see someview 
        myscrollView.scrollTo(loc[0], loc[1]); 
       } 
       catch (Exception e) { 
        e.printStackTrace(); 
       } 
      }} 
     }; 

     Rect scrollBounds = new Rect(); 
     View divider=findViewById(R.id.someview); 
     myscollView.getHitRect(scrollBounds); 
     if (!divider.getLocalVisibleRect(scrollBounds)) { 
      // the divider view is NOT within the visible scroll window thus we need to scroll a bit. 
      myscollView.postDelayed(shifter, 500); 
     } 



    }); 

//은 본질적으로 우리가 실행 가능한을을 당신이 화면에 표시 WANT 일부보기의 새 위치로 스크롤됩니다. scrollviews 범위 내에 있지 않으면 (화면에없는 경우에만) 해당 실행 파일을 실행합니다. 이 방법은 scrollview를 참조 된 뷰 (내 경우에는 라인 디바이더 인 'someview')로 이동합니다.

관련 문제