我有4种不同的设备:
我想知道我的设备的最小宽度(sw)为它做一个支撑布局.
我想创建一个像"layout-sw600dp"这样的资源文件夹,但我不知道最小宽度(sw)的值.
我尝试使用以下代码打印sw:
DisplayMetrics metrics = getResources().getDisplayMetrics();
Log.i("Density", ""+metrics.densityDpi);
Run Code Online (Sandbox Code Playgroud)
但我不知道这是否是正确的价值.
如何找到最小宽度(sw)?
我的ListView中有一个ListView显示ImageButton.
我将focusalble"false"和focusableInTouchMode"false"设置为ImageButton.
我设置了ListView.OnItemClickListner.当我运行我的项目它显示我的ListView.
但是当我点击Listview它不起作用.
然后我在布局中删除ImageButton并在我单击ListView它工作时再次运行我的项目
怎么了?
我的ListView在PopupWindow中.
当我显示PopupWindow并点击设备ASUS K00z fonepad中的Listview行时非常好.
但在HTC Z715e不工作(onitem点击事件未被解雇)
这是我的listview项目布局
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/ln_testpopitemcon"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="52dp"
android:background="#3b8ed4"
android:descendantFocusability="blocksDescendants">
<ImageView
android:id="@+id/img_testiconmenu"
android:layout_margin="10dp"
android:layout_width="32dp"
android:layout_height="32dp"
android:src="@drawable/radio_selected"
android:clickable="false"
android:focusable="false"
android:focusableInTouchMode="false"/>
<TextView
android:id="@+id/tv_testtitlemenu"
android:gravity="left|center_vertical"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:clickable="false"
android:focusable="false"
android:focusableInTouchMode="false"/>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
这是我的弹出式布局
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/ln_testpopocontainer"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<ListView
android:paddingLeft="2dp"
android:paddingRight="2dp"
android:paddingBottom="2dp"
android:id="@+id/lv_testpop"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:choiceMode="singleChoice"
android:dividerHeight="2dp"
android:background="#00000000"
android:orientation="vertical"/>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
这是我的适配器
public class testmenuadapter extends BaseAdapter{
private Context context;
private ArrayList<MenuInfo> MenuList;
private LayoutInflater Layf;
public testmenuadapter(Context context, ArrayList<MenuInfo> menuList){
this.context = context;
this.MenuList = menuList;
this.Layf = …Run Code Online (Sandbox Code Playgroud) android android-listview onitemclicklistener android-popupwindow
我在谷歌地图上设置了标记但是当我拖动它时,所有的地图都是拖动的.
点击并拖动时我想要拖动标记
单击并拖动标记外拖动地图.
这是我的代码
self.camera = [GMSCameraPosition cameraWithLatitude:-33.86 longitude:151.20 zoom:6 bearing:0 viewingAngle:0];
self.Map = [GMSMapView mapWithFrame:self.MapView.bounds camera:self.camera];
self.Map.myLocationEnabled = YES;
self.Map.delegate = self;
GMSMarker *marker = [[GMSMarker alloc] init];
marker.position = self.camera.target;
marker.draggable = YES;
marker.title = @"Sydney";
marker.snippet = @"Australia";
marker.map = self.Map;
marker.icon = [GMSMarker markerImageWithColor:[UIColor blueColor]];
marker.appearAnimation = kGMSMarkerAnimationPop;
[self.MapView addSubview:self.Map];
Run Code Online (Sandbox Code Playgroud)
这是拖拽事件
- (void) mapView:(GMSMapView *)mapView didBeginDraggingMarker:(GMSMarker *)marker
{
}
- (void) mapView:(GMSMapView *)mapView didEndDraggingMarker:(GMSMarker *)marker
{
}
- (void) mapView:(GMSMapView *)mapView didDragMarker:(GMSMarker *)marker
{
}
Run Code Online (Sandbox Code Playgroud)
当我运行我的应用程序并调试所有上述事件不起作用.但事件点击标记工作很好. …
google-maps drag-and-drop objective-c ios google-maps-sdk-ios
我想在谷歌地图上创建20个不同的标记.
当我从RGB设置UIColor时,某些颜色不匹配.
teamColor = [UIColor colorWithRed:255.0/255.0 green:250.0/255.0 blue:229.0/255.0 alpha:1]
marker.icon = [GMSMarker markerImageWithColor:teamColor];
//when i set marker to this colour it's show different i want
Run Code Online (Sandbox Code Playgroud)
当我设置黑色或白色时,它会显示加里.
如何知道哪种颜色支持GMSMarker?
我在我的应用程序中使用android webview来显示来自youtube的视频,效果很好。
但我希望它是自动播放的。
这是我的活动,我在videoUrl后面附加了“?autoplay = 1”,但没有任何变化,它仍然不是自动播放。
public class LandVideoAct extends Activity {
WebView mWebView;
String videoURL = "";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.landfull);
videoURL = "http://www.youtube.com/embed/VYIi49czywo?autoplay=1";
mWebView = (WebView) findViewById(R.id.fullwebview);
String vid = "<html><body style=\"margin: 0; padding: 0\"><iframe width=\"100%\" height=\"100%\" src=\""+videoURL+"\" type=\"text/html\" frameborder=\"0\"></iframe><body><html>";
WebChromeClient mWebChromeClient = new WebChromeClient(){
public void onProgressChanged(WebView view, int newProgress) {
}
};
mWebView.getSettings().setPluginState(WebSettings.PluginState.ON);
mWebView.setWebChromeClient(mWebChromeClient);
mWebView.setWebViewClient(new WebViewClient() {
public void onPageFinished(WebView view, String url) {
mWebView.loadUrl("javascript:(function() { document.getElementsByTagName('video')[0].play(); })()");
} …Run Code Online (Sandbox Code Playgroud) 我有
<div id="d1" class="hov"></div>
Run Code Online (Sandbox Code Playgroud)
和
<div id="d2" class="hov"></div>
Run Code Online (Sandbox Code Playgroud)
而CSS则是
.hov:hover{
background-color:#cde0c4;
cursor:pointer;
}
Run Code Online (Sandbox Code Playgroud)
当我在d1上盘旋时,我希望d2悬停相同.如何同时悬停多个DIV?
android ×4
google-maps ×2
ios ×2
css ×1
gmsmapview ×1
html ×1
iframe ×1
javascript ×1
listview ×1
objective-c ×1
webview ×1
xcode5 ×1
youtube ×1