2012-08-10 2 views
1

MapView에 이미 많은 버튼이 있습니다. 그래서 하단의 투명 컨트롤도 내장하고 싶습니다. getZoomControl() (MapView)은 더 이상 사용되지 않습니다. 누구든지 getZoomControl없이 컨트롤에 Buttons을 보유하는 방법에 대한 아이디어가 있습니까? MapView에서 ZoomControl을 투명하게 만드는 방법은 무엇입니까?

편집 :

그래서 나는 그것을 알아 냈어. ZoomButtonsController에는 단지 ViewGroup 인 컨테이너가 있음이 밝혀졌습니다. 그 컨테이너 아이들을 통해 의 인스턴스 인 객체를 파싱 할 수 있습니다. 이것은 ViewGroup의 라인 인스턴스 아래입니다. ZoomControl의 하위 항목을 분석하여 포함 된 ZoomButtons을 가져올 수 있습니다. ZoomButtonsetAlpha()getBackground()

android.widget.ZoomButtonsController zbc = mapView.getZoomButtonsController(); 
    ViewGroup container = zbc.getContainer(); 
    for (int i = 0; i < container.getChildCount(); i++) { 
     View child = container.getChildAt(i); 
     if (child instanceof ZoomControls) { 
      ViewGroup zoomC = (ViewGroup)child; 
      for (int j = 0; j < zoomC.getChildCount(); j++) { 
       View btn = zoomC.getChildAt(j); 
       if (btn instanceof ZoomButton) { 
        ((ZoomButton)btn).getBackground().setAlpha(120); 
       } 
      } 
      break; 
     } 
    } 

답변

0

내 이해를 위해 android.view.View에는 사용되지 않지만 android.widget.ZoomButtonsController에 있습니다. 도움이되는지 확실하지 않습니다. 알려줘. 다큐먼트에 제안

Here is some documentation.

0

은 줌 버튼의 내장을 제거하고 자신의 버튼을 사용하여 줌 작업을 수행하기 위해 자신의 행동을 설정

여기 내 코드입니다. 단추를 원하는 모양으로 만들 수 있습니다.

관련 문제