如何在 android 中使用 setBounds 执行boundCenterBottom?
我正在制作一个应用程序,可以在某个位置设置固定位置。我希望该位置位于图像的底部中心。我正在使用 setBounds 方法来创建边界,但我不确定如何使其成为“boundCenterBottom”
drawable = Maps.this.getResources().getDrawable(pincolorstar[ImTracking.pList.get(k).getPosition()]);
// right now the bounds are putting the marker way off target
drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight());
//more stuff
OverlayItem overlayitem = new OverlayItem(myPoint, mList.get(i).getName(), mList.get(i).getTime());
overlayitem.setMarker(drawable);
I'm making an app that sets a pin down on a certain location. I would like the location to be at the bottom center of the image. I'm using the setBounds method to create the bound but I'm not sure how to make it "boundCenterBottom"
drawable = Maps.this.getResources().getDrawable(pincolorstar[ImTracking.pList.get(k).getPosition()]);
// right now the bounds are putting the marker way off target
drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight());
//more stuff
OverlayItem overlayitem = new OverlayItem(myPoint, mList.get(i).getName(), mList.get(i).getTime());
overlayitem.setMarker(drawable);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不确定这是否有效,现在无法检查,但请尝试:
I'm not sure this will work and can't check it right now, but try: