我知道如何制作圆角矩形,像这样
<?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)
它看起来像这样:
但我想让它的反面(中心透明,侧面填充颜色),它应该是这样的:
谢谢
我有一个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)