0

私はアプリで、whatsappアプリのようにアクションバーの真ん中にクリック可能なテキストを表示しようとしています。この写真では、アクションバーに人物の詳細とクリック可能なものが表示されます。私が探しているもの

ここに画像の説明を入力

字幕ともちろんアクションバーのメインタイトルを追加できることがわかりましたが、その正確なものに対して良い結果が見つからなかったようです ありがとうございます:)

4

2 に答える 2

0

TextViewとして追加CustomViewすると、プレーンなタイトルを模倣すると同時にクリック可能になり、代わりにsetTitle(). TextViewに提供する前に、クリック リスナーを に追加しますActionBar。のサイズに伸ばすことを忘れないでくださいActionBar

このアイデアがお役に立てば幸いです。

編集:

タイトルとサブタイトルのテキストのサイズに関して同じ外観を得るには、styles.xml を参照してください。

<style name="TextAppearance.Widget.ActionBar.Title"
       parent="@android:style/TextAppearance.Medium">
</style>

<style name="TextAppearance.Widget.ActionBar.Subtitle"
       parent="@android:style/TextAppearance.Small">
</style>



<style name="TextAppearance.Medium">
    <item name="android:textSize">18sp</item>
</style>

<style name="TextAppearance.Small">
    <item name="android:textSize">14sp</item>
    <item name="android:textColor">?textColorSecondary</item>
</style> 
于 2013-05-29T10:40:35.493 に答える