本文共 799 字,大约阅读时间需要 2 分钟。
(在回答你关于在另一个上面的视图设置最后的评论。)
简单,你可以使用多个LinearLayouts这样的:
android:id="@+id/tab1"
... />
android:text="Predefined Message"
... />
... />
你的LinearLayout(也许TextView)应该有一个OnClickListener来完成主要功能,ImageButton将为该工具提示提供第二个OnClickListener。
或您可以使用RelativeLayout将带有OnClickListener的工具提示ImageButton放置在带有自己的OnClickListener的TextView顶部。
如果您愿意,您可以将这些自定义视图中的任意一个传递给ActionBar以为您构建选项卡。希望有所帮助。
加成
的(!丑)RelativeLayout的例子:
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="A long text sample"
/>
android:id="@+id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignRight="@+id/button1"
android:layout_marginRight="10dp"
android:text="i"
/>
转载地址:https://blog.csdn.net/weixin_32306771/article/details/117546617 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!