12

私は、最新の GoogleMap API (V2) を実装するネイティブ Android アプリに取り組んでおり、アクセシビリティの苦情を (できる限り) 行う必要があります。

contentDescription 属性を mapView に追加すると、問題なく動作します - TalkBack はそれを認識します。

ただし、Marker または InfoWindow のレイアウトに同じ属性を追加すると、TalkBack によって無視されます。

GoogleMap は、膨張したレイアウトを内部的にビットマップにレンダリングし、このビットマップを mapview の上に表示し、 contentDescription 属性を無視しているようです。その結果、対応する画像がクリックされても、TalkBack は何も言いません。

最新の Googlemap で contentDescription を InfoWindow または Marker に追加する方法について、別の経験や知識を持っている人はいますか?

ありがとう。

4

3 に答える 3

3

マーカーについては、使用marker.setTitile()して機能しましたが、InfoWindow を機能させる方法はまだわかりません。

于 2015-12-07T10:29:24.507 に答える
-1

新しい情報ウィンドウをデザインするということですか? 最初に .xml レイアウト ファイルを記述してから、次の手順を実行する必要があります。

map.setInfoWindowAdapter(new InfoWindowAdapter() {
        // Use default InfoWindow frame
        @Override
        public View getInfoWindow(Marker arg0) {
            return null;
        }

        // Defines the contents of the InfoWindow
        @Override
        public View getInfoContents(Marker arg0) {
            String namepic = arg0.getTitle();
            // Getting view from the layout file info_window_layout
            View v = getLayoutInflater()
                    .inflate(R.layout.info_window, null);
            LatLng latLng = arg0.getPosition();
            // Getting the position from the marker

            TextView tvtitle = (TextView) v.findViewById(R.id.tv_title);
            TextView tvLat = (TextView) v.findViewById(R.id.tv_lat);
            TextView tvLng = (TextView) v.findViewById(R.id.tv_lng);
            ImageView myimage = (ImageView) v.findViewById(R.id.my_image);

            tvtitle.setText(arg0.getTitle());
            tvLat.setText("Latitude:" + latLng.latitude);
            tvLng.setText("Longitude:" + latLng.longitude);
            // Returning the view containing InfoWindow contents
            myimage.setImageResource(getResources().getIdentifier(namepic,
                    "drawable", getPackageName()));
            return v;
        }
    });
于 2015-05-29T02:53:43.693 に答える