我想创建和加密获取在 url 中传递的变量和异步调用
例如:
$textToEncrypt = "Hello World";
$encryptionMethod = "AES-256-CBC";
$secretHash = "cVb67YtfAz328oOikl96vBn";
$iv = "adfrf54dmnlo09ax";
$encryptedText = openssl_encrypt($textToEncrypt,$encryptionMethod,$secretHash, 0, $iv);
Run Code Online (Sandbox Code Playgroud)
结果是:W2p0S2qlSierJnIcA/AM3g==
有一些特殊字符, == 总是在最后。我要防止这种情况!如何仅输出 0-9 和 AZ 和 az 字符?
谢谢
我想在一个片段中创建一些dinamically的单选按钮,我只有样式问题.如果我将radiobutton代码放在xml文件中,则会正确应用默认样式,但是当我通过函数创建radiobutton时,我会看到不同的样式!
XML
<RadioGroup
android:id="@+id/radiogroup"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:animationCache="false">
<RadioButton
android:text="RadioButton 1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/radioButton3" />
<RadioButton
android:text="RadioButton 2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/radioButton4" />
</RadioGroup>
Run Code Online (Sandbox Code Playgroud)
结果
JAVA CODE
此代码放在片段中的onCreateView中
public void addRadioButton(Context ctx,int num){
RadioGroup radioGroup= (RadioGroup) alertInflatedView.findViewById(R.id.radiogroup);
for (int i = 1; i <= num; i++) {
RadioButton radioButton = new RadioButton(ctx);
radioButton.setId(1+i);
radioButton.setText("Radio " + radioButton.getId());
radioButton.setTextColor(getResources().getColor(R.color.black));
radioGroup.addView(radioButton);
}
}
Run Code Online (Sandbox Code Playgroud)
结果
正如你所看到的单选按钮有不同的风格,有人可以帮助我,如果可能的话,以编程方式应用默认样式?