小编Mat*_*zka的帖子

如何制作带有倒圆角的矩形?

我知道如何制作圆角矩形,像这样

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
    <solid
        android:color="#FF0000"/>
    <corners
        android:radius="10000dp" />
</shape>
Run Code Online (Sandbox Code Playgroud)

它看起来像这样:

在此处输入图片说明

但我想让它的反面(中心透明,侧面填充颜色),它应该是这样的:

在此处输入图片说明

谢谢

layout android background shapes

10
推荐指数
1
解决办法
3347
查看次数

连接到不支持三星Galaxy Core Prime(Android 5.1.1)的gatt服务器

我有一个BLE应用程序可以在Android 6.0及更高版本的设备上运行,但我在三星Galaxy Core Prime(Android 5.1.1)上有问题.在调用之后connectGatt没有任何反应并且回调只接收断开状态.

我已经删除了适当的代码:

BluetoothManager bluetoothManager = (BluetoothManager) getSystemService(Context.BLUETOOTH_SERVICE);
BluetoothAdapter bluetoothAdapter = bluetoothManager.getAdapter();
final BluetoothDevice device = bluetoothAdapter.getRemoteDevice(address);
Log.e("BluetoothLeService", "connect: connectGatt(this, false, mGattCallback)");
BluetoothGatt bluetoothGatt = device.connectGatt(this, false, mGattCallback);

private final BluetoothGattCallback mGattCallback = new BluetoothGattCallback() {
    @Override
    public void onConnectionStateChange(BluetoothGatt gatt, int status, int newState) {
        if (newState == BluetoothProfile.STATE_CONNECTED) {
            Log.e("BluetoothLeService", "onConnectionStateChange: STATE_CONNECTED");
        } else if (newState == BluetoothProfile.STATE_DISCONNECTED) {
            Log.e("BluetoothLeService", "onConnectionStateChange: STATE_DISCONNECTED");
        }
    }

    @Override
    public void onServicesDiscovered(BluetoothGatt gatt, int status) {
    } …
Run Code Online (Sandbox Code Playgroud)

android bluetooth bluetooth-lowenergy gatt

5
推荐指数
1
解决办法
218
查看次数