Android 开发初尝试,尝试编译遇到问题
Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Inverse'. Message{kind=ERROR, text=Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Inverse'., sources=[C:\Users\admin.gradle\caches\transforms-1\files-1.1\appcompat-v7-26.1.0.aar\1d8531ccbcfb5f99866244a0b7edccc6\res\values-v23\values-v23.xml:4:5-135], original message=, tool name=Optional.of(AAPT)}
Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Colored'. Message{kind=ERROR, text=Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Colored'., sources=[C:\Users\admin.gradle\caches\transforms-1\files-1.1\appcompat-v7-26.1.0.aar\1d8531ccbcfb5f99866244a0b7edccc6\res\values-v23\values-v23.xml:34:5-105], original message=, tool name=Optional.of(AAPT)}
Caused by: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: Error while executing process C:\Users\admin\AppData\Local\Android\Sdk\build-tools\26.0.2\aapt.exe with arguments {package -f --no-crunch -I C:\Users\admin\AppData\Local\Android\Sdk\platforms\android-22\android.jar -M \?\E:\HistogramTest\app\build\intermediates\manifests\full\debug\AndroidManifest.xml -S E:\HistogramTest\app\build\intermediates\res\merged\debug -m -J \?\E:\HistogramTest\app\build\generated\source\r\debug -F E:\HistogramTest\app\build\intermediates\res\debug\resources-debug.ap_ --custom-package com.example.asus.histogramtest -0 apk --output-text-symbols \?\E:\HistogramTest\app\build\intermediates\symbols\debug --no-version-vectors}
代码贴上:
package com.example.asus.histogramtest;
import android.app.Activity; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.view.ViewDebug; import android.widget.Button;
import com.example.asus.histogramtest.DiyView.HistogramView; import com.example.asus.histogramtest.bean.HistogramData;
import java.util.ArrayList;
public class MainActivity extends Activity {
private ArrayList<HistogramData> histogramDatas; //数据
private HistogramView histogramView; //直方图 View
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// histogramView.setVisibility(View.INVISIBLE);
histogramDatas = new ArrayList<>();
histogramDatas.add(new HistogramData(6, "6"));
histogramDatas.add(new HistogramData(16, "16"));
histogramDatas.add(new HistogramData(5.5f, "5.5"));
histogramDatas.add(new HistogramData(1.4f, "1.4"));
histogramDatas.add(new HistogramData(1.015f, "1.015"));
histogramDatas.add(new HistogramData(80, "80"));
histogramDatas.add(new HistogramData(1.0f, "1.0"));
histogramDatas.add(new HistogramData(33, "33"));
histogramDatas.add(new HistogramData(66, "66"));
histogramDatas.add(new HistogramData(4.0f, "4.0"));
histogramDatas.add(new HistogramData(125, "125"));
histogramView = (HistogramView) findViewById(R.id.h);
// histogramView.setData(histogramDatas);
//Button v=findViewById(R.id.btn);
// v.setVisibility(View.INVISIBLE);
findViewById(R.id.btn).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//histogramView.setVisibility(View.VISIBLE);
histogramView.setData(histogramDatas);
// v.setVisibility(View.INVISIBLE);
}
});
}
}
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.