2016-10-30 17 views

答えて

6

場所ボタンが実際にImageViewのです。あなたが最初のマップに関連付けられているフラグメントのビューを取得する必要があります。

SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager() 
            .findFragmentById(R.id.map); 

次は、フラグメントから位置アイコンの参照を取得する必要があります

ImageView locationButton = (ImageView) mapFragment.getView().findViewById(2); 

それはあなたが欲しいものをイメージだ変更を。例えば

locationButton.setImageResource(R.drawable.icon_location); 

希望します。

+0

awesomeまたlocationButton.setBackgroundResourceも機能しています – mehmet

0

は、私はあなたが以下のコードで「現在地」ボタンビューを持つことができると思う:

View locationButton = ((View) mapView.findViewById(Integer.parseInt("1")).getParent()).findViewById(Integer.parseInt("2")); 
関連する問題