如何在android studio上运行应用程序时打开调试模式.
我的应用程序出现在 - Android Device Monitor- Devices选项卡上.当我在此屏幕上单击应用程序行时,调试图标未激活
运行我的应用程序后如何进入调试模式?
如何将此cocos2d-iphone代码移植到cocos2d-x?
(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
NSSet *allTouches = [event allTouches];
switch ([allTouches count]) {
case 1:
{
UITouch *touch = [[allTouches allObjects] objectAtIndex:0];
switch([touch tapCount])
{
case 1:
// ??!
break;
case 2:
//Double tap.
// ??!
break;
}
break;
}
}
Run Code Online (Sandbox Code Playgroud) 这是三角形的xml:
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:id="@+id/shape_id">
<rotate
android:fromDegrees="45"
android:toDegrees="45"
android:pivotX="-40%"
android:pivotY="87%" >
<shape android:shape="rectangle" >
<stroke android:width="10dp"/>
</shape>
</rotate>
</item>
</layer-list>
Run Code Online (Sandbox Code Playgroud)
这是textview的背景
<TextView
android:id="@+id/headlineSelect_TXT2"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_weight="1"
android:background="@drawable/category_triangle_shape1"
android:visibility="invisible" />
Run Code Online (Sandbox Code Playgroud)
我想以编程方式改变形状的颜色.我试过这个,但我得到空指针异常
LayerDrawable bgDrawable = (LayerDrawable) getActivity()
.getResources()
.getDrawable(R.drawable.category_triangle_shape1);
final GradientDrawable shape = (GradientDrawable) bgDrawable
.findDrawableByLayerId(R.id.shape_id);
shape.setStroke(10,Color.GREEN);
Run Code Online (Sandbox Code Playgroud)
我怎样才能做到这一点?感谢帮助.