相关疑难解决方法(0)

Android:BOTTOM上的标签

我已经看到一些关于这个的喋喋不休,但没有什么明确的.有没有办法将TabWidget中的标签放到屏幕底部?如果是这样,怎么样?

我尝试了以下,但没有奏效:

a)在tablayout下面设置tabwidget
b)将tabwidget的引力设置为"bottom"

谢谢!llappall

android tabwidget

148
推荐指数
4
解决办法
16万
查看次数

Android - iphone风格tabhost

是否可以将Android Tabhost设置为类似iPhone的样式?如果没有,是否有任何开源代码可以显示如何为Android创建底部选项卡?

alt text http://images.appshopper.com/screenshots/305/690205_2.jpg 替代文字

tabs android android-style-tabhost android-tabhost

29
推荐指数
3
解决办法
4万
查看次数

android RadioButton按钮可绘制重力

我正在动态生成RadioButtons

RadioButton radioButton=new RadioButton(context);  

LayoutParams layoutParams=new LayoutParams(radioWidth,radioHeight);
layoutParams.gravity=Gravity.CENTER;

radioButton.setLayoutParams(layoutParams);
radioButton.setGravity(Gravity.CENTER);

BitmapDrawable bitmap = ((BitmapDrawable)drawableResource);
bitmap.setGravity(Gravity.CENTER);

radioButton.setBackgroundDrawable(getResources().getDrawable(R.drawable.itabs_radio));
radioButton.setButtonDrawable(bitmap);
Run Code Online (Sandbox Code Playgroud)

你可以看到我拼命想把按钮的重力设置为中心,但没有理由它总是居中和左对齐,继承人的原因 - 安卓单选按钮的默认样式:

<style name="Widget.CompoundButton">
<item name="android:focusable">true</item> 
<item name="android:clickable">true</item>
<item name="android:textAppearance">?android:attr/textAppearance</item> 
<item name="android:textColor">?android:attr/textColorPrimaryDisableOnly</item> 
<item name="android:gravity">center_vertical|left</item> 
</style>

<style name="Widget.CompoundButton.RadioButton">
<item name="android:background">@android:drawable/btn_radio_label_background</item> 
<item name="android:button">@android:drawable/btn_radio</item> 
</style>
Run Code Online (Sandbox Code Playgroud)

有什么方法可以将按钮对齐到中心吗?

android center radio-button drawable

26
推荐指数
2
解决办法
2万
查看次数