小编sal*_*lai的帖子

错误:(2,0)找不到ID为"com.github.dcendents.android-maven"的插件

我使用以下库将材料设计添加到我的android项目中
https://github.com/navasmdc/MaterialDesignLibrary

但在将其作为模块导入后,我收到以下错误.我该如何解决呢?

Error:(2, 0) Plugin with id 'com.github.dcendents.android-maven' not found.
Run Code Online (Sandbox Code Playgroud)

android gradle android-gradle-plugin material-design

11
推荐指数
3
解决办法
3万
查看次数

响应式设计适用于所有Android设备

我使用两种不同的方法来实现Android设备中的响应式设计

方法1.我在不同的文件夹中使用了不同的dimens.xml

values-hdpi
values-ldpi
values-mdpi
values-xhdpi  
values-xxhdpi
Run Code Online (Sandbox Code Playgroud)

方法2.我将所有布局复制到

layout
layout-large
layout-small
layout-xlarge
Run Code Online (Sandbox Code Playgroud)

文件夹和给定不同的高度,宽度和其他

当我使用第一种方法时,我没有得到正确的响应设计,当我使用第二种方法时,我得到了正确的设计,但它增加了应用程序的大小.

所以,请告诉我实现100%响应式设计的最佳流程,而不是我的两种方法

xml android android-layout responsive-design

8
推荐指数
1
解决办法
2737
查看次数

使用Toolbar和SwipeRefreshLayout的正确方法是什么?

我正在尝试使用SwipeRefreshLayout和工具栏但是每次我使用Progress Circle都会出现在工具栏上,这在设计方面非常糟糕.我尝试将SwipeRefreshLayout放在工具栏下但不起作用,进度圆仍然出现在它上面(状态栏上方).我想像Gmail应用程序一样同时使用工具栏和布局.我正在使用AppCompat库.

这是我的代码:

<?xml version="1.0" encoding="utf-8"?>


   <android.support.v4.widget.SwipeRefreshLayout 
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/swipe_container"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">




    <ScrollView
        android:layout_width="fill_parent"
        android:layout_height="fill_parent">


        <RelativeLayout
            android:layout_width="fill_parent"
            android:layout_height="fill_parent">

            <include layout="@layout/bluetooth_toolbar"
                android:id="@+id/bluetooth_toolbar"/>


            <TextView
                android:id="@+id/swipeTo"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Swipe down to refresh"
                android:textSize="20sp"
                android:layout_below="@+id/bluetooth_toolbar"
                android:layout_centerHorizontal="true" />

            <ListView
                android:id="@+id/newDevices"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_below="@id/swipeTo"
                android:layout_marginTop="50dp" />

            <ListView
                android:id="@+id/pairedDevices"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_below="@id/newDevices"
                android:layout_marginTop="50dp" />
        </RelativeLayout>
    </ScrollView>

   </android.support.v4.widget.SwipeRefreshLayout>
Run Code Online (Sandbox Code Playgroud)

public class BluetoothActivity extends AppCompatActivity implements SwipeRefreshLayout.OnRefreshListener {


private static final int REQUEST_ENABLE_BT = 0;
private BluetoothAdapter bluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
private SwipeRefreshLayout mSwipeRefreshLayout;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState); …
Run Code Online (Sandbox Code Playgroud)

android toolbar swiperefreshlayout android-toolbar appcompatactivity

7
推荐指数
1
解决办法
1900
查看次数

在viewpager中显示Youtube视频

我想在其中设置YouTube视频ViewPager.为此我设置FrameLayout了适配器,我在其中设置了YoutubeVideoFragment,如下所示:

我的ViewPager适配器:

import android.app.Activity;
import android.app.FragmentTransaction;
import android.content.Context;
import android.os.Bundle;
import android.support.v4.view.PagerAdapter;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import java.util.List;

import np.com.test.R;
import np.com.test.fragment.YoutubeVideoFragment;

/**
 * Created by Vikash on 8/18/2015.
 */
public class TutorialVideoAdapter extends PagerAdapter {
private List<String> mList;
private Activity mActivity;

public TutorialVideoAdapter(Activity activity, List<String> list) {
    mActivity = activity;
    mList = list;
}

@Override
public int getCount() {
    return mList.size();
}

@Override
public boolean isViewFromObject(View view, Object object) {
    return …
Run Code Online (Sandbox Code Playgroud)

youtube android android-fragments android-viewpager

6
推荐指数
2
解决办法
3062
查看次数

Ionic:模拟器:错误:这个AVD的配置缺少一个内核文件!模拟器:错误:ANDROID_SDK_ROOT未定义

我创建了一个带有离子的应用程序,在Android中构建,然后当我运行"离子模拟android"时,我收到以下错误:

"模拟器:错误:此AVD的配置缺少内核文件!!模拟器:错误:ANDROID_SDK_ROOT未定义"

我在互联网上阅读,其中大多数人说我需要安装ARM EABI v7a系统映像.我有android studio,我打开了sdk并为所有版本的android(4.2.1,4.2.2等)安装了所有包(包含ARM EABI v7a System Image).

首先,如何查看我在离子中使用的android版本?

其次,我该如何解决这个错误?

sdk android android-emulator ionic-framework ionic

6
推荐指数
1
解决办法
1万
查看次数

在Bootstrap 3中设置Textarea的宽度

我一直在寻找一种方法让我的'textarea'在它的专栏中达到100%.我已经看到了几种不同的方式(我没有能够工作)使"textarea"在Bootstrap中扩展到100%.我从CSS自定义样式到使用class ="form-control col-lg-12"来覆盖Bootstrap的CSS.

任何人都有一个工作建议,允许液体重新调整大小?

这是我的代码.现在,宽度比占位符文本稍微过了一点.

<div class="row">
            <div class="col-lg-7">
                <h2>@Model.EmployeeName</h2>
                <h3>Employee #: @Model.EmployeeNumber</h3>

                <h5>(Optional): Exception Log comments related to this shift for your Supervisor/Time Keeper.</h5>
                <textarea rows="2" placeholder="Exception Log comments."></textarea>
            </div>
            <div class="col-lg-5 text-right">
                <div ng-controller='TimeCtrl'>
                    <h2>{{ clock | date:'fullDate'}}</h2>
                    <h1>{{ clock | date:'HH:mm:ss'}}</h1>
                    <input type="submit" class="btn btn-xxlarge btn-success" value="Punch In" />
                </div>
            </div>
        </div>
Run Code Online (Sandbox Code Playgroud)

css twitter-bootstrap twitter-bootstrap-3

6
推荐指数
1
解决办法
2万
查看次数

获取 webview 光标位置

我正在使用WebView库中的富文本编辑器,我试图将字符串插入光标当前位置。在EditText我能够使用getSelectionStartand知道光标当前位置getSelectionEnd,但是WebView没有这样的方法,谁能帮我知道如何知道光标当前位置并将字符串插入到该位置?

android position cursor selection webview

5
推荐指数
0
解决办法
740
查看次数

在绘制路径时更改部分路径的颜色

我设法创建自己的自定义路径绘图应用程序,如下所示

public class CanvasView extends View {
Context context;
HashMap<Integer,PathWrapper> locToPath=new HashMap<>();
ArrayList<PathWrapper> activePaths=new ArrayList<>();
CoMingleAndroidRuntime<Screenshare> screenRuntime;
boolean inited=false;
Integer myLocation;
public CanvasView(Context context,AttributeSet attr) {
    super(context, attr);
    setWillNotDraw(false);
    this.context = context;
}

public void init(CoMingleAndroidRuntime<Screenshare> screenRuntime){
    inited=true;
    this.screenRuntime=screenRuntime;
    this.myLocation=screenRuntime.getLocation();
    addPath(myLocation);
    invalidate();
}

public void addPath(int Location){
    Paint mPaint=new Paint();
    mPaint.setColor(Color.BLACK);
    mPaint.setAlpha(195);
    mPaint.setStyle(Paint.Style.STROKE);
    mPaint.setStrokeJoin(Paint.Join.ROUND);
    mPaint.setStrokeWidth(50f);
    locToPath.put(Location, new PathWrapper(new Path(), mPaint, Location));
}
@Override
protected void onDraw(Canvas canvas) {
    super.onDraw(canvas);
    for(PathWrapper path:activePaths){
        canvas.drawPath(path.path, path.paint);
    }
    invalidate();
}
public void respondActionColorChanged(int R,int …
Run Code Online (Sandbox Code Playgroud)

android canvas

4
推荐指数
1
解决办法
2074
查看次数

如何使用右侧的默认展开/折叠图标指示器制作expandablelistview?

我正在开发一个设计的Android应用程序.

http://prntscr.com/86wnmm

这里exapandablelistview的默认图标指示器显示在左侧.如何在列表视图的右侧显示此图标指示符?,Xml文件中是否有任何更改可以实现此操作?

我的xml代码是

`

<ExpandableListView
    android:id="@+id/expandableListView"
    android:layout_height="match_parent"
    android:layout_width="match_parent"
    android:indicatorRight="?android:attr/expandableListPreferredItemIndicatorRight"
    android:dividerHeight="0.7dp" />
Run Code Online (Sandbox Code Playgroud)

`

android indicator expandablelistview

3
推荐指数
1
解决办法
1万
查看次数

由于插件错误,Android构建失败

我刚刚安装了插件com.rjfun.cordova.plugin.admob,但上个月我删除了插件.我刚刚删除了插件文件夹以删除插件.当我尝试构建项目时,我确实收到了错误.

这些是我尝试过的东西:

以这种方式删除插件:  cordova plugin rm com.rjfun.cordova.plugin.admob.删除com.rjfun.cordova.plugin.admob的插件fetch.xmlandroid.xml在plugins文件夹中的文件.

这是我在输入时遇到的错误cordova build android::

   Error: ENOENT, no such file or directory 'C:\Users\Dirk\Hollan d App 2015\Ionic\Holland\plugins\com.rjfun.cordova.plugin.admob\plugin.xml' at Object.fs.openSync (fs.js:432:18) at Object.fs.readFileSync (fs.js:289:15) at Object.module.exports.parseElementtreeSync (C:\Users\Dirk\AppData\Roam ing\npm\node_modules\cordova\node_modules\cordova-lib\src\util\xml-helpers.js:11 8:27) at new PluginInfo (C:\Users\Dirk\AppData\Roaming\npm\node_modules\cordova \node_modules\cordova-lib\src\PluginInfo.js:298:37) at PluginInfoProvider.get (C:\Users\Dirk\AppData\Roaming\npm\node_modules \cordova\node_modules\cordova-lib\src\PluginInfoProvider.js:35:32) at C:\Users\Dirk\AppData\Roaming\npm\node_modules\cordova\node_modules\co rdova-lib\src\plugman\prepare.js:79:45 at Array.forEach (native) at Object.handlePrepare (C:\Users\Dirk\AppData\Roaming\npm\node_modules\c ordova\node_modules\cordova-lib\src\plugman\prepare.js:77:24) at C:\Users\Dirk\AppData\Roaming\npm\node_modules\cordova\node_modules\co rdova-lib\src\cordova\prepare.js:108:21 at Array.map (native)
Run Code Online (Sandbox Code Playgroud)

我希望任何人都有同样的问题或知道解决这个问题的方法.

谢谢!

android cordova ionic-framework

2
推荐指数
1
解决办法
768
查看次数