我安装了Android Studio 0.1.9.今天我得到并更新到0.2版本,当然我更新了.安装完成后,我重新启动了Android Studio,但现在收到此消息:
Project正在使用旧版本的Android Gradle插件.支持的最低版本为0.5.0.请更新依赖项'com.android.tools.build:gradle'的版本
我怎么做?我在android studio中找不到任何gradle插件的更新工具.
如何让Xcode在发布模式下构建OS X应用程序?我似乎只能找到早期版本的说明,没有任何截图匹配.当我将"释放"放入帮助菜单的搜索时,我没有看到任何内容.
对于api <21,按钮看起来很好.但是,+ 21版本会创建此边框或阴影,如下图所示.如何在不更改孔主题的情况下摆脱它,但设置样式变量?

在这张彩色图像上可能会更清楚.按钮周围有某种边框.

我的buttonssstyle定义如下:
<style name="buttonTransparent" parent="Base.TextAppearance.AppCompat.Button">
<item name="android:background">#00000000</item>
<item name="android:textColor">@drawable/button_text_blue</item>
<item name="android:textSize">18dp</item>
<item name="android:textAllCaps">false</item>
<item name="android:minHeight">45dp</item>
</style>
<style name="buttonLargeWhite" parent="buttonTransparent">
<item name="android:background">#FFF</item>
<item name="android:layout_marginTop">10dp</item>
</style>
Run Code Online (Sandbox Code Playgroud) 我在按钮上有一个图像,我想在用户点击它时旋转它.我几乎都有它工作.单击时图像旋转正常,但不会围绕其中心旋转.
如何使图像围绕其中心而不是左上角旋转?
这是我的代码:
<Button Name="btnRefreshPortList"
Grid.Column="1"
Margin="10 0 0 0"
Command="{Binding RefreshPortList}">
<Image Source="Images/refresh.jpg"
Height="15">
<Image.RenderTransform>
<RotateTransform x:Name="AnimatedRotateTransform" Angle="0" />
</Image.RenderTransform>
<Image.Triggers>
<EventTrigger RoutedEvent="MouseDown">
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetName="AnimatedRotateTransform"
Storyboard.TargetProperty="Angle"
By="10"
To="360"
Duration="0:0:0.5"
FillBehavior="Stop" />
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Image.Triggers>
</Image>
</Button>
Run Code Online (Sandbox Code Playgroud)
BR FireFly3000
你能帮我弄清楚为什么团体和孩子之间有空间吗?在我的情况下,我想要所有组之间的空格,孩子应该在组的正下方没有空间(但当然空间到下一组.我的问题看起来像这样:

我已将Group divider设置为这个drawable(expandable_list_group_divider):
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<size android:height="10dp"/>
</shape>
Run Code Online (Sandbox Code Playgroud)
和子分隔符(@ drawable/expandable_list_child_divider):
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<size android:height="0dp"/>
</shape>
Run Code Online (Sandbox Code Playgroud)
我在xml中定义了这样的布局(它是一个复合控件):
<com.jws.MyExpandableListView
android:id="@+id/expList"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:scrollbars="none"
android:divider="@drawable/expandable_list_group_divider"
android:childDivider="@drawable/expandable_list_child_divider"/>
Run Code Online (Sandbox Code Playgroud)
自定义视图类:
public class MyExpandableListView extends ExpandableListView {
protected ArrayList<Departure> departures;
public MyExpandableListView(Context context, AttributeSet attrs) {
super(context, attrs);
setGroupIndicator(null);
setChildIndicator(null);
setHorizontalFadingEdgeEnabled(true);
setVerticalFadingEdgeEnabled(true);
setFadingEdgeLength(60);
departures = new ArrayList<Departure>();
this.setAdapter(new MyExpandableListAdapter(context, this, departures));
}
}
Run Code Online (Sandbox Code Playgroud)
最后是可扩展列表适配器
public class DeparturesExpandableListAdapter extends BaseExpandableListAdapter {
private final int DIVIDER_HEIGHT = 20;
private LayoutInflater …Run Code Online (Sandbox Code Playgroud) 我希望我在Android 4.0中的动画很慢而且缺乏.所以我想启用硬件加速,并试图做这个页面所说的但没有运气.
你可以在这里看到我的清单:
<?xml version="1.0" encoding="UTF-8"?>
<manifest android:versionCode="1" android:versionName="1.0"
package="com.jws.battleship" xmlns:android="http://schemas.android.com/apk/res/android">
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="15"/>
<uses-permission android:name="android.permission.BLUETOOTH"/>
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@android:style/Theme.Black.NoTitleBar"
android:hardwareAccelerated="true">
<activity
android:label="@string/app_name"
android:name=".HomeActivity"
android:hardwareAccelerated="true">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity android:name=".UserPreferences"/>
<activity android:name=".BattleActivity" android:screenOrientation="landscape"/>
<activity android:name=".HighScoreActivity"/>
<activity android:name=".StoreActivity"/>
<activity android:name=".JoinBattle"/>
<activity android:name=".CreateBattleActivity"/>
<activity android:name=".FriendList"/>
<activity android:name=".FriendListActivity"/>
<activity android:name=".SelectNetworkActivity"/>
<activity android:name=".BluetoothDevicesListActivity"/>
<activity android:name=".NetworkFactoryActivity"/>
</application>
</manifest>
Run Code Online (Sandbox Code Playgroud)
然后我测试它是否在onCreate()中启用了硬件加速,如下所示:
ListView list = (ListView)findViewById(R.id.home_list_active_games);
Boolean test = list.isHardwareAccelerated();
Run Code Online (Sandbox Code Playgroud)
但它总是返回假!?我是否需要添加某种权限或此处有什么问题?
BR
我有一个使用谷歌地图的Android应用程序.但是,当我运行应用程序时,我得到以下警告:
V/GoogleSignatureVerifier:com.google.android.gms签名无效
我认为它与debug.keystore文件有关,但我不确定.您对如何为其提供有效签名有任何建议吗?
我正在设置一个数据表样式,但我无法弄清楚如何设置数据网格的左上角字体.这张照片中的灰色区域:

你知道怎么做吗?
到目前为止,这是我的风格:
<Style TargetType="{x:Type DataGrid}">
<Setter Property="Margin" Value="5" />
<Setter Property="Background">
<Setter.Value>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="White"/>
<GradientStop Color="AliceBlue" Offset="1"/>
</LinearGradientBrush>
</Setter.Value>
</Setter>
<Setter Property="RowBackground">
<Setter.Value>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#BAF0FF"/>
<GradientStop Color="PowderBlue" Offset="1"/>
</LinearGradientBrush>
</Setter.Value>
</Setter>
<Setter Property="AlternatingRowBackground">
<Setter.Value>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="White"/>
<GradientStop Color="AliceBlue" Offset="1"/>
</LinearGradientBrush>
</Setter.Value>
</Setter>
<Setter Property="HorizontalGridLinesBrush" Value="LightGray" />
<Setter Property="VerticalGridLinesBrush" Value="LightGray" />
</Style>
Run Code Online (Sandbox Code Playgroud) 我需要一个文件(MYFILE.TXT)的全名,并正在考虑标题和Diaplay名称MediaColumns.你能告诉我两者之间的区别以及何时使用哪个?
我有一个带有激活的OpenVPN服务的DD-WRT路由器.我创建了以下启动脚本,我希望将Netflix从VPN隧道中排除.但是,我还没有成功.当我在whatsmyip.org查找ip时,我仍然得到VPN服务器的IP,而不是我自己的.你能看出什么问题吗?
SCRIPT_DIR="/tmp/etc/config"
SCRIPT="$SCRIPT_DIR/add-routes.wanup"
mkdir -p $SCRIPT_DIR
cat << "EOF" > $SCRIPT
#!/bin/sh
# dd-wrt selective domain routing
WAN_GWAY="0.0.0.0"
while [ $WAN_GWAY == "0.0.0.0" ]; do
sleep 3
WAN_GWAY=`nvram get wan_gateway`
done
# list domains for selective routing
for domain in \
"netflix.com" \
"ichnaea.netflix.com" \
"movies.netflix.com" \
"www.netflix.com" \
"nflxext.com" \
"cdn1.nflxext.com" \
"nflximg.com" \
"nflxvideo.net" \
"ipv4_1.cxl0.c145.sjc002.ix.nflxvideo.net" \
"amazonaws.com" \
"whatsmyip.org"
do
# extract ip addresses
for ip in $(nslookup $domain | awk '/^Name:/,0{if (/^Addr/)print $3}'); do
# add …Run Code Online (Sandbox Code Playgroud)