我正在使用appcompat_v7库.
在文档中说:
[...] AppCompat在早期版本的Android上为UI小部件的子集提供了类似的行为:
AppCompat工具栏提供的所有内容(动作模式等)
这是我的代码:
价值观/ styles.xml
<style name="AppBaseTheme" parent="Theme.AppCompat">
<item name="colorPrimary">@color/material_blue_grey_800</item>
<item name="colorPrimaryDark">@color/material_blue_grey_950</item>
<item name="colorAccent">@color/material_deep_teal_200</item>
</style>
Run Code Online (Sandbox Code Playgroud)
布局/ activity_main.xml中
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.example.lollipoptest.MainActivity" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hello_world" />
<CheckBox
android:id="@+id/checkBox1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/textView1"
android:layout_centerHorizontal="true"
android:layout_marginTop="28dp"
android:text="CheckBox" />
<RadioButton
android:id="@+id/radioButton1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/checkBox1"
android:layout_centerHorizontal="true"
android:text="RadioButton" />
<EditText
android:id="@+id/editText1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/radioButton1"
android:layout_centerHorizontal="true"
android:ems="10" >
<requestFocus />
</EditText>
Run Code Online (Sandbox Code Playgroud)
默认MainActivity.java没有任何更改
操作栏显示新的材质样式.编辑文本也是.但复选框和radiobutton没有.我做错了什么?
照片:https: //drive.google.com/file/d/0B1jx6rK5CDqTRnhYVDU3V21JRlk/view?usp=sharing
如何为旧版本设计材料?
我尝试添加appcompat_v7到我的项目但不幸的是没有改变任何东西.
请帮忙!
我使用以下教程来实现材料设计抽屉.
http://www.androidhive.info/2015/04/android-getting-started-with-material-design/
但是我想在2个项目之后在抽屉中添加部分.如何制作recyclerview显示部分和子标题?
当缩小到某个范围时,其他对象后面的对象的材质开始闪耀.它看起来非常类似于面重叠时的效果(面在同一平面内).
为了证明这一点,我做了一个小提琴.
在这个例子中,我绘制了两个薄盒子(厚度为1,盒子之间也有一个空的空间),所以盒子不会相互接触,但材料无论如何都要照射.
// geometry with thickness 1
var geometry = new THREE.BoxGeometry(20000, 20000, 1);
Run Code Online (Sandbox Code Playgroud)
此屏幕截图演示了效果:

此屏幕截图显示两个几何之间存在空格.

缩放时,效果有时会出现,有时会消失(这也取决于缩放距离和屏幕大小).
我尝试使用不同的材料属性,但我似乎无法找到任何阻止这种情况发生的材料设置.
这是一个错误吗?或WebGL限制?或3D图形的一般限制?或者我错过了什么,这实际上是材料或渲染器配置错误?
在我的模特中,这种效果真的很令人不安和丑陋.我可以以某种方式防止这种情况发生吗?
我对角度和材质非常陌生,在禁用角度4材质中未选择的选项卡时遇到了一个难题,我在下面只有此代码。
<md-tab-group class="flex-stretch tab-button-arrows">
<md-tab *ngFor="let subject of subjects" label="subject.name" ></md-tab>
</md-tab-group>
Run Code Online (Sandbox Code Playgroud)
注意:该受试者 是一个动态数组。
我用自己的顶点和索引创建了一个箭头然后我将朗伯材料和材质颜色设置为红色.我无法在渲染中看到材质.只是黑色.
但是,如果我将材料设置为基本材料,我可以看到颜色.
arrowMesh = new THREE.Mesh(
arrowGeometry,
new THREE.MeshLambertMaterial({ color : 'red', side: THREE.DoubleSide })
);
arrowMesh.position.set(-10,5,95);
arrowMesh.rotation.x = -1.0;
arrowMesh.rotation.z = -0.2;
scene.add(arrowMesh);
Run Code Online (Sandbox Code Playgroud)
three.js r64
你好:)我想改变我的应用程序,因此它将具有Material主题,所以..我安装了新的adt,在sdk管理器上更新所有,并做了这些东西:
我打开了一个新文件 - /res/values/styles.xml并在那里使用了这段代码:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- your app's theme inherits from the Material theme -->
<style name="AppTheme" parent="android:Theme.Material">
<!-- theme customizations -->
</style>
</resources>
Run Code Online (Sandbox Code Playgroud)
在AndroidManifest我使用了这段代码:
<uses-sdk
android:minSdkVersion="19"
android:targetSdkVersion="20" />
Run Code Online (Sandbox Code Playgroud)
在styles.xml我收到此错误:
"错误:检索项目的父项时出错:找不到与给定名称'android:Theme.Material'匹配的资源."
我需要改变什么?
当我在Android Studio中创建一个新项目时,dafault app主题是"Theme.appCompat.light".我尝试将"Theme.Material"设置为清单中的主题Android Studio没有显示任何建议,并且找不到"Theme.Material".我更新了sdk管理器中的所有内容.我有什么办法使用Material Theme?
未捕获的错误:模块构建失败:错误:ENOENT:没有此类文件或目录,请打开'/Users/leongaban/projects/go/src/github.com/pizzahutdigital/mythor/node_modules/material-ui/styles/getMuiTheme.js'
目前,使用http://www.material-ui.com/#/中的主题,样式和组件来构建应用程序。
但是我需要0.9在https://material-ui-next.com/layout/grid/中不存在但存在于其中的Grid组件1.0 beta
I'm using mat-menu from angular/material:
<button mat-button [matMenuTriggerFor]="menu">Menu</button>
<mat-menu #menu="matMenu">
<button mat-menu-item id = "item1">Item 1</button>
<button mat-menu-item id = "item2">Item 2</button>
</mat-menu>
Run Code Online (Sandbox Code Playgroud)
In the Page Object po.ts, I'm searching for the first button:
getMenuButton() {
return element(by.buttonText('Menu'));
}
getItem1Button() {
return element(by.id('item1'));
}
Run Code Online (Sandbox Code Playgroud)
In the .spec files, I'm trying to click on the first button:
po.getMenuButton().click();
expect(get.getItem1Button().isDisplayed()).toBe(true);
po.getItem1Button().click();
Run Code Online (Sandbox Code Playgroud)
I'm getting this error:
- Failed: unknown error: Element <button _ngcontent-c1="" class="mat-menu-item
ng-tns-c1-0 ng-star-inserted" mat-menu-item="" role="menuitem" tabindex="0"
ng-reflect-router-link="item1" id="item1" aria-disabled="false">...</button> …Run Code Online (Sandbox Code Playgroud) material ×10
android ×5
javascript ×3
angular ×2
themes ×2
three.js ×2
drawer ×1
e2e-testing ×1
material-ui ×1
navigation ×1
protractor ×1
rendering ×1
styles ×1