-2
A
答えて
0
は、まあ、これは私にカスタマイズされたダイアログのように見える丸い角を持つこのメニューをしたいあなたは、あなたがそのようなことを描くことができる方法を意味している場合、私はそれを管理するための簡単な方法だと思います、いくつかのラジオボタンを含む通常のアクティビティを作成し、そのアクティビティのテーマをダイアログテーマに変更し、そのアクティビティをメニュー項目、アクションなどに割り当てます。
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//hook up the radio buttons and button here and give them actions
}
}
レイアウト.XMLファイル:ここに例があり、私はそれだけで知っていた、私はそれが助け:)
活動のJavaコードのいくつかの並べ替えを提供することを願って
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/white"
tools:context="com.dall.radiobut.MainActivity">
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:text="the title"
android:textColor="@android:color/black"
android:textSize="25sp"
android:textStyle="bold" />
<RadioGroup
android:id="@+id/radioGroup"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="@+id/textView">
<RadioButton
android:id="@+id/radioButton1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="first action"
android:textColor="@android:color/black" />
<RadioButton
android:id="@+id/radioButton2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="second action"
android:textColor="@android:color/black" />
<RadioButton
android:id="@+id/radioButton3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="third action"
android:textColor="@android:color/black" />
<RadioButton
android:id="@+id/radioButton4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="forth action"
android:textColor="@android:color/black" />
</RadioGroup>
<Button
android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_below="@+id/radioGroup"
android:layout_margin="5dp"
android:text="cancel"/>
</RelativeLayout>
androidManifest .XML:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.dall.radiobut">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@android:style/Theme.Holo.Dialog.NoActionBar.MinWidth">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
ここで最終製品です!
+0
これは丸い角ではありませんが、 –
関連する問題
- 1. 角を丸くした角のテーブル
- 2. 丸い角を持つ `ListView`メニューをスタイリング
- 3. NSTableViewの角を丸くした
- 4. MKMapViewの角を丸くしたもの
- 5. Silverlightでグリッドの角を丸くした
- 6. 角を丸くしたUIButton setBackgroundImage
- 7. コンテンツを角を丸くしたDIV要素にクリップするベストプラクティス
- 8. 角が丸くなった角テーブルLESS
- 9. NSRectの角を丸く
- 10. IE8で角を丸くする方法
- 11. 角を丸くしてNSImageViewを作成する方法は?
- 12. ボタンの内側の端に角を丸くするには
- 13. Chromeはホバー上のメニューの丸い角を無視しています
- 14. 角を丸めたdiv内でiframeをスクロールすると、角が丸くなります。
- 15. androidのtextviewの片隅の角を丸くするには
- 16. 電子browserWindowで角を丸くするには?
- 17. 私のフレックスウィジェット全体が角を丸くするには?
- 18. CSS表セルレイアウトの角を丸くしましたか?
- 19. UITableViewのセルを区切り、角を丸くした
- 20. IOSメニュー/デザイン
- 21. ドラッグ中に丸みを帯びた四角形を描く
- 22. 角を丸めたFabricJSキャンバス
- 23. 角を丸めたFrameLayout
- 24. メニューを更新した後にメニューが消える。角度
- 25. UIButtonを編集して角を丸くする
- 26. UIImageViewをアスペクトフィッティングモードの角を丸くして設定する方法
- 27. jqueryで画像の角を丸くした
- 28. iOS UITableViewCell cell.imageView角を丸く設定した
- 29. 角を丸くして正方形を描く
- 30. 角を丸くして選択したものを強調表示します
Googleがあなたの地域にいるのですか? 'android custom dialogfragment'のためのgoogleだけ –
これまで行ってきたこととあなたの正確な問題は何ですか?また、なぜグーグルが成功しなかったのでしょうか? –
ボタンをクリックすると、コンテキストメニューが開きます。そして四角形ではなく四角形として表示されたコンテキストメニュー –